We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In 0.3.x, the iv_len of SS_RC4_MD5 is changed from 16 to 0.
iv_len
SS_RC4_MD5
16
0
https://github.com/shadowsocks/shadowsocks-crypto/blob/main/src/v1/streamcipher/rc4_md5.rs#L45
https://github.com/shadowsocks/shadowsocks-crypto/blob/v0.2.5/src/v1/streamcipher/rc4_md5.rs#L24
The text was updated successfully, but these errors were encountered:
const KEY: &'static [u8] = b"1234123412341234"; const EMPTY_IV: &'static [u8] = b"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; const EMPTY: &'static [u8] = b""; const MSG: &'static [u8] = b"Hello, world!"; fn old_enc() -> Vec<u8> { let mut cipher = old_crypto::v1::Cipher::new(old_crypto::v1::CipherKind::SS_RC4_MD5, KEY, EMPTY_IV); let mut helloworld = MSG.to_vec(); cipher.encrypt_packet(&mut helloworld); helloworld } fn main() { let mut helloworld = old_enc(); let mut cipher = old_crypto::v1::Cipher::new(old_crypto::v1::CipherKind::SS_RC4_MD5, KEY, EMPTY_IV); assert!(cipher.decrypt_packet(&mut helloworld)); assert_eq!(helloworld, MSG); let mut helloworld = old_enc(); let mut cipher = fix_crypto::v1::Cipher::new(fix_crypto::v1::CipherKind::SS_RC4_MD5, KEY, EMPTY_IV); assert!(cipher.decrypt_packet(&mut helloworld)); assert_eq!(helloworld, MSG); println!("{:?}", helloworld); let mut helloworld = old_enc(); // NOTE that the IV len is zero, so it's impossible to decrypt let mut cipher = new_crypto::v1::Cipher::new(new_crypto::v1::CipherKind::SS_RC4_MD5, KEY, EMPTY); assert!(cipher.decrypt_packet(&mut helloworld)); // assert failed here assert_eq!(helloworld, MSG); }
https://github.com/spacemeowx2/bug-crypto
Sorry, something went wrong.
I think a regression test needs to be done for each CipherKind.
0185e54
fixed regression, rc4-md5 cipher IV length should be 16
5ffab23
- ref shadowsocks/shadowsocks-crypto#12
zonyitoo
No branches or pull requests
In 0.3.x, the
iv_len
ofSS_RC4_MD5
is changed from16
to0
.https://github.com/shadowsocks/shadowsocks-crypto/blob/main/src/v1/streamcipher/rc4_md5.rs#L45
https://github.com/shadowsocks/shadowsocks-crypto/blob/v0.2.5/src/v1/streamcipher/rc4_md5.rs#L24
The text was updated successfully, but these errors were encountered: