Base64-decoding packaged message works.
[easyotp.git] / try.c
bloba0462993196eecd4540af9346f9e2be119d50474
1 /** Practical One-time Pad Library
3 * Created:20080514
4 * By Jeff Connelly
5 */
7 #include <stdio.h>
8 #include "libotp.h"
10 extern PAD *pads;
12 int main()
14 MESSAGE *m;
16 load_pad("/Volumes/Not Backed Up/otp/otp-dazzlement");
17 load_pad("/Volumes/Not Backed Up/otp/otp-dazzlement");
18 load_pad("/Volumes/Not Backed Up/otp/otp-dazzlement");
20 printf("offset=%ld\n", read_offset(pads));
21 write_offset(pads, 1213475);
22 printf("offset=%ld\n", read_offset(pads));
24 m = unpackage("--EMOTP_BEGIN--0,\n"
25 "aGVsbG8gd29ybGQ=\n"
26 "--EMOTP_END--\n");
28 free_message(m);
31 m = unpackage("--EMOTP_BEGIN--1213434,\n"
32 "gK1O22FPbxLmxrROfFHDCsM1LTsOAjjbRlHVM1p+WG+s6yslYVfzvtc=\n"
33 "--EMOTP_END--\n");
35 free_message(m);
37 unpackage("--EMOTP_BEGIN--978,dc,\n"
38 "hUZm1q0gX7pa6Alzbo9OZiT8wA==\n"
39 "--EMOTP_END--\n");
41 unpackage("--EMOTP_BEGIN--1213475,\n"
42 "k7z/WLuOwZ7FUl+eCbf4nchljDYqwbgE30rMw2jawU7IyLLHsF1xnxXuDkjkL486MFeInftCSjjV\n"
43 "hMHJHq4WGbuf8JmSCiPxcyzlyMaR5rDY1jmFhLHdp9LYmXODqY1VbOGRtPn2Fp4HhMX9yW1AGEEg\n"
44 "hztze7K8ipdqd6U5SKuYNmW6YBEaZZZJg4BhbPdUjBZLYUl4VBftcXlOGWJG3A+r7RFOl3VhNrXd\n"
45 "--EMOTP_END--");
47 show_pads();
48 free_pads();
50 return 0;