mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-09 06:47:59 -06:00
Add salt to AES key
This commit is contained in:
@@ -123,13 +123,15 @@ impl Base62 {
|
||||
let base = Base62::new(&key, length % 255);
|
||||
let encoded = base.encode(data);
|
||||
|
||||
// For the case that the encoded length is not equal to the predicted length
|
||||
// The nonce must be derived from this length, so this needs to be ensured
|
||||
//
|
||||
// Re-encode with the correct length
|
||||
if encoded.len() != length {
|
||||
let len = encoded.len();
|
||||
let base = Base62::new(&key, len % 255);
|
||||
let encoded = base.encode(data);
|
||||
|
||||
println!("Fallback");
|
||||
|
||||
assert_eq!(encoded.len(), len);
|
||||
|
||||
encoded
|
||||
@@ -141,8 +143,6 @@ impl Base62 {
|
||||
let base = Base62::new(&key, data.len() % 255);
|
||||
base.decode(data)
|
||||
}
|
||||
|
||||
// pub fn encode_full
|
||||
}
|
||||
|
||||
// Helper: Check if big integer (as bytes) is zero
|
||||
|
||||
Reference in New Issue
Block a user