skerkour / kerkour.com

(Ab)using technology for fun & profit. Programming, Hacking & Entrepreneurship @ https://kerkour.com
https://kerkour.com
Apache License 2.0
463 stars 63 forks source link

Error: Decrypting large file: aead::Error routine #40

Closed HelixTP closed 2 years ago

HelixTP commented 2 years ago

Hello I found a small error or omission in the decryption function, you forgot to add 16 bytes to BUFFER_LEN (based or you other code to encrypt file

const BUFFER_LEN: usize = 500;

to

const BUFFER_LEN: usize = 500 + 16;

sylvain101010 commented 2 years ago

Hello, thank you for the feedback!

What portion of the code are you talking about? Please provide a link to the file, because at least here: https://github.com/skerkour/kerkour.com/blob/main/2021/rust_file_encryption/src/main.rs const BUFFER_LEN: usize = 500 + 16; seems correct.

HelixTP commented 2 years ago

Hello, At line 126, in the main.r file.

But in the code of the blog the error is not there.

sylvain101010 commented 2 years ago

Line 126? https://github.com/skerkour/kerkour.com/blob/80f17624b1708b2ce9620af2a352afd92cae13cc/2021/rust_file_encryption/src/main.rs#L126

HelixTP commented 2 years ago

Non, in rust_file_encryption_with_password, need add 16 bytes to BUFFER_LEN

sylvain101010 commented 2 years ago

Thanks!

It's now fixed :)