AES (Advanced Encryption Standard). Cryptography example.
AES (Advanced Encryption Standard). Cryptography example.
The irreducible polynomial P(x) = x^4 +x +1.
#include <stdio.h >
#include <math.h >
include <mcrypt.h>
int main()
{
char * plaintext = "mytxt";
char* IV = "nsjsjsjJdjdnJdj";
char *key = "0123456789abcdef";
int keysize = 16; /* 128 bits */
char* buffer;
int buffer_len = 16;
buffer = calloc(1, buffer_len);
strncpy(buffer, plaintext, buffer_len);
encrypt(buffer, buffer_len, IV, key, keysize);
printf("Text encrypted : %c", buffer) ;
return 0;
}
#c #unix #linux #ethicalhacker #math #mathematics #cryptography #encryption
#aes
The irreducible polynomial P(x) = x^4 +x +1.
#include <stdio.h >
#include <math.h >
include <mcrypt.h>
int main()
{
char * plaintext = "mytxt";
char* IV = "nsjsjsjJdjdnJdj";
char *key = "0123456789abcdef";
int keysize = 16; /* 128 bits */
char* buffer;
int buffer_len = 16;
buffer = calloc(1, buffer_len);
strncpy(buffer, plaintext, buffer_len);
encrypt(buffer, buffer_len, IV, key, keysize);
printf("Text encrypted : %c", buffer) ;
return 0;
}
#c #unix #linux #ethicalhacker #math #mathematics #cryptography #encryption
#aes
Commenti
Posta un commento