Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. void cbc_mode_test() {
  2. int i;
  3. uint32_t key[] = {0x7e7a9cb4, 0x89a201f3, 0x14d6fed4, 0xbe21afea};
  4.  
  5. uint32_t text[] = { 0x9e4587e3, 0xe49383a2,
  6. 0xe1432902, 0xbe790210,
  7. 0xa39ffe11, 0x93333276,
  8. 0x21247348, 0x85956106,
  9. 0x169f5ea6, 0xdb8a7137 };
  10.  
  11. uint32_t iv[] = { 0x74f78c88, 0x8d8844a1 };
  12. text[0] = iv[0] ^ text[0];
  13. text[1] = iv[1] ^ text[1];
  14.  
  15. printf("(CBC) plaintext = ");
  16.  
  17. for(int i = 0; i< 10 ; i++)
  18. {
  19. ciphertext[i] = encrypt(text[i] ^ ciphertext[i]-1,key[0]);
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement