Skip to content
New issue

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

Output double in size, AES in CTR #319

Open
GideonKock opened this issue Nov 2, 2023 · 0 comments
Open

Output double in size, AES in CTR #319

GideonKock opened this issue Nov 2, 2023 · 0 comments

Comments

@GideonKock
Copy link

GideonKock commented Nov 2, 2023

As the code describes, I have an input of 18 characters, but the result is 36 characters long. I expected the output to be the same length compared to the input. Why is the output double the size of the input?

    final iv = e.IV.fromBase16(hexMessage.substring(0, 24));
    final key = e.Key.fromBase16(HEX.encode(Uint8List.fromList(aesPrivateKey!)));
    final encrypter = e.Encrypter(e.AES(key,mode: e.AESMode.ctr,padding: null)); // Gebruik AES met de gegenereerde sleutel
    final encrypted = encrypter.encrypt(hexMessage.substring(28), iv: iv); // Versleutel het bericht met de IVbericht met de IV
    print(hexMessage.substring(28));
    print(encrypted.base16);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant