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
Version: commit 2385675 VS 2017 Windows 7 x64 (for testing)
The decryption result in bytes/string is:
46 a9 dc 7b 96 19 b8 61 8c df a2 1c 94 c7 8e c1 54 68 69 73 20 F©Ü{–.¸aŒß¢.”ÇŽÁThis 69 73 20 70 61 74 72 69 63 6b 21 54 68 69 73 20 69 73 20 70 61 is patrick!This is pa 74 72 69 63 6b 21 54 68 69 73 20 69 73 20 70 61 74 72 69 63 6b trick!This is patrick 21 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 !
The expected string result should be:
This is patrick!This is patrick!This is patrick!This is patrick!
Here is the code example:
#include <stdio.h> #define CBC 1 #define CTR 1 #define ECB 1 #include <string.h> #include "../aes.h" int main() { struct AES_ctx ctx; char input[] = "This is patrick!This is patrick!This is patrick!This is patrick!"; size_t inlen = strlen(input); char copyin[256] = { 0 }; strcpy(copyin, input); char key[] = "gmufm6nfjcylr4pf"; char iv[] = "ThisFuckinIvHere"; AES_init_ctx_iv(&ctx, key, iv); AES_CBC_encrypt_buffer(&ctx, copyin, inlen); AES_CBC_decrypt_buffer(&ctx, copyin, inlen); printf("CBC decrypt: "); if (0 == memcmp(input, copyin, inlen)) { printf("SUCCESS!\n"); return 0; } printf("FAILURE!\n"); return 1; }
The text was updated successfully, but these errors were encountered:
If not mistaken, I believe you have to reinitialise the context before trying to decrypt :)
Sorry, something went wrong.
Oops! You right, now it works! 👍
No branches or pull requests
Version: commit 2385675
VS 2017
Windows 7 x64 (for testing)
The decryption result in bytes/string is:
The expected string result should be:
This is patrick!This is patrick!This is patrick!This is patrick!
Here is the code example:
The text was updated successfully, but these errors were encountered: