Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdint.h>
- void print_key(uint8_t* key) {
- uint8_t i;
- for(i=0; i<16; ++i) {
- printf("%02x",key[i]);
- }
- putchar('\n');
- }
- int main(void) {
- FILE* rnd;
- uint8_t key[16];
- uint32_t count;
- count = 0;
- rnd = fopen("/dev/urandom", "rb");
- while(1){
- uint8_t i;
- fread(key, 1, 16, rnd);
- print_key(key);
- count += 16;
- if(count == 0xFFFFFFF0) {
- count = 0;
- fclose(rnd);
- rnd = fopen("/dev/urandom", "rb");
- }
- }
- fclose(rnd);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement