From f49f8917e590f55bb5f21c8220ff517c19588aa6 Mon Sep 17 00:00:00 2001 From: couturie Date: Sat, 14 Apr 2018 17:08:49 +0200 Subject: [PATCH] first version of cipher_jpg --- CipherImg/cipher_jpg.cpp | 106 ++++++++++++++++++++ OneRoundIoT/OneRound/one_round_hash.cpp | 72 ++++++++++++- OneRoundIoT/OneRound/one_round_hash_new.cpp | 25 +++-- 3 files changed, 194 insertions(+), 9 deletions(-) create mode 100644 CipherImg/cipher_jpg.cpp diff --git a/CipherImg/cipher_jpg.cpp b/CipherImg/cipher_jpg.cpp new file mode 100644 index 0000000..ccd9f8c --- /dev/null +++ b/CipherImg/cipher_jpg.cpp @@ -0,0 +1,106 @@ +//g++ cipher_jpg.cpp -o cipher_jpg -O3 + +//cipher_jpg ~/Pictures/ecuador\ 2013/IMG_7548.JPG 38762 +//usage cipher_jpg image seed + +#include +#include +#include +#include + + +using namespace std; + +typedef unsigned char uchar; + +uchar modulo(int x,int N){ return (x % N + N) %N; } + +void fxor(uchar *buf,int sz, int seed,int enc) { + int start,end; + + for(int i=1;i=end) + cout<<"pb"<=end) + cout<<"pb"<0;a--) { Z[a-1]=Z[a]^Y[a]; } - for(int a=0;a