CTFs and solutions
This commit is contained in:
6
openssl-rand/format.py
Normal file
6
openssl-rand/format.py
Normal file
@ -0,0 +1,6 @@
|
||||
rand1="4c-75-82-ca-02-07-bd-1d-8d-52-f0-6c-7a-d6-b7-87-83-95-06-2f-e0-f7-d4-24-f8-03-68-97-41-4c-85-29-e5-0d-b0-e4-3c-ee-74-dc-18-8a-aa-26-f0-46-94-e8-52-91-4a-43-8f-dd-ea-bb-a8-cf-51-14-79-ec-17-c2"
|
||||
rand1=rand1.split("-")
|
||||
output=""
|
||||
for i in rand1:
|
||||
output+="\\x"+i
|
||||
print(output)
|
||||
21
openssl-rand/openssl-rand.c
Normal file
21
openssl-rand/openssl-rand.c
Normal file
@ -0,0 +1,21 @@
|
||||
#include <stdio.h>
|
||||
#define MAX 64
|
||||
int main(){
|
||||
unsigned char rand1[MAX]="\xed\x8a\x3b\xe8\x17\x68\x38\x78\xf6\xb1\x77\x3e\x73\xb3\xf7\x97\xf3\x00\x47\x76\x54\xee\x8d\x51\x0a\x2f\x10\x79\x17\xf8\xea\xd8\x81\x83\x6e\x0f\x0c\xb8\x49\x5a\x77\xef\x2d\x62\xb6\x5e\xe2\x10\x69\xd6\xcc\xd6\xa0\x77\xa2\x0a\xd3\xf7\x9f\xa7\x9e\xa7\xc9\x08";
|
||||
unsigned char rand2[MAX]="\x4c\x75\x82\xca\x02\x07\xbd\x1d\x8d\x52\xf0\x6c\x7a\xd6\xb7\x87\x83\x95\x06\x2f\xe0\xf7\xd4\x24\xf8\x03\x68\x97\x41\x4c\x85\x29\xe5\x0d\xb0\xe4\x3c\xee\x74\xdc\x18\x8a\xaa\x26\xf0\x46\x94\xe8\x52\x91\x4a\x43\x8f\xdd\xea\xbb\xa8\xcf\x51\x14\x79\xec\x17\xc2";
|
||||
|
||||
unsigned char k1[MAX];
|
||||
unsigned char k2[MAX];
|
||||
unsigned char key[MAX];
|
||||
for(int i=0; i<64; i++){
|
||||
k1[i]=rand1[i]|rand2[i];
|
||||
k2[i]=rand1[i]&rand2[i];
|
||||
key[i]=k1[i]^k2[i];
|
||||
}
|
||||
printf("CRYPTO25{");
|
||||
for(int i=0; i < MAX; i++)
|
||||
printf("%02x-", key[i]);
|
||||
printf("}");
|
||||
printf("\n");
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user