Guest User

Untitled

a guest
Dec 13th, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. uint8_t in[] = { 0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a };
  2. struct AES_ctx ctx;
  3.  
  4. AES_init_ctx(&ctx, key);
  5. AES_ECB_encrypt(&ctx, in);
  6.  
  7. printf("ECB encrypt: ");
  8.  
  9. if (0 == memcmp((char*) out, (char*) in, 16))
  10. {
  11. printf("SUCCESS!n");
  12. }
  13. else
  14. {
  15. printf("FAILURE!n");
  16. }
Add Comment
Please, Sign In to add comment