Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Hash has arbitrary seed-independent multicollisions, is not DoS resistant #83

Open
Assignees
ogxd
Milestone
@orlp

Description

@orlp

There are probably other issues as well, but this line is particularly problematic:

letmut tmp1 =aes_encrypt(v0, v2);

This is trivial to invert and allows you to create arbitrary seed-independent multicollisions. I would suggest not advertising DoS resistance on this hash at all.

// Not an endorsement of aes_crypto, just the first crate// I could find that allows cross-platform single-round encryption.use aes_crypto::AesBlock;fnmain(){let zero_key =AesBlock::zero();letmut s0 =[0u8;192];letmut s1 =[0u8;192];    s0[64] =100;    s1[64] =42;let v0 =AesBlock::new(s0[64..64 +16].try_into().unwrap());    v0.enc(zero_key).store_to(&mut s0[64 +32..]);let v0 =AesBlock::new(s1[64..64 +16].try_into().unwrap());    v0.enc(zero_key).store_to(&mut s1[64 +32..]);// Different strings.assert!(s0 != s1);// Collide regardless of seed.assert!(gxhash::gxhash128(&s0,0) == gxhash::gxhash128(&s1,0));assert!(gxhash::gxhash128(&s0,0xdeadbeef) == gxhash::gxhash128(&s1,0xdeadbeef));}

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp