Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Quesion: encode with openssl command line #77

Open
jamiebullock opened this issue Oct 30, 2024 · 0 comments
Open

Quesion: encode with openssl command line #77

jamiebullock opened this issue Oct 30, 2024 · 0 comments

Comments

@jamiebullock
Copy link

jamiebullock commented Oct 30, 2024

In my application, I would like to encode data with openssl from the command line, and decode it with AES in C++.

However, I am struggling to get the right options for openssl.

I have tried:

echo -n "1234567890123456" | openssl enc -e -aes-128-ecb -nopad -nosalt -k FooBar > file

And decrypt with:

AES encryption(AESKeyLength::AES_128);
unsigned char key[] = {0x46, 0x6F, 0x6F, 0x42, 0x61, 0x72};
auto out = encryption.DecryptECB(data, size, key);

However the results are garbage.

My code works fine if I encrypt with EncryptECB().

Anyone know the correct settings for openssl to make it work with AES?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant