Dual Message Encryption
Overview
This program will take 2 files and 2 keys and spits out one large encrypted file(It was made after a discussing this article with a friend). You can use this data to retrieve either one file or the other depending on which key you give it. The encrypted data is interleaved with each other, so no message's encryption is stronger than the other. The secrecy of the message is determined by how strong the method is for hashing from the key given, in this implementation it should be equivalent to brute forcing a 128bit key.
Downloads
- denc.cpp -- The encryption algorithm implemented in C++
- ddec.cpp -- The decryption algorithm implemented C++
- dualEnc.tar.gz -- All the code together with a makefile
Algorithm
Let m1 be message 1
Let m2 be message 2 assume length is equal to m1
Let k1 be the key corresponding to m1.
Let k2 be the key corresponding to m2
Let p1 be a polynomial equation whose coefficients are determined by k1
Let p2 be a polynomial equation whose coefficients are determined by k2
Let hs be the size of m1 plus some small constant(Used to speed up hashing and add random data later).
Let h1 be a hash of m1 of size hs with p1 being used as the hashing function.
Let h2 be a hash of m2 of size hs with p2 being used as the hashing function.
With this an encrypted file can be made from the following information:
hs
p1(1)
p2(1)
sizeOf(m1)
sizeOf(m2)
t1 = h1 xor h2
t2 = h1 interleave h2 (A list of characters where even elements correspond to h1's even elements, and odd elements correspond to h2's odd elements)
Decryption be done as follows(Assume k is the key provided for decryption):
p = polynomial(k) Polynomial derived from the key supplied
h is a hash table to keep track of what elements have been used to resolve collisions
if ( p1(1) == p(1) ) msgSize = sizeOf(m1) and isEven = true
else if ( p2(1) == p(1) ) msgSize = sizeOf(m2) and isEven = true
for(i=0; i < msgSize; i++)
   h[ p(i) ] = true;
   if(( p(i)%2 == 0 && isEven) || ( p(i)%2 == 1 && !isEven)) write(t2[p(i)])
   else write(t2[ p(i) ] xor t1[ p(i) ])
Conclusion
Works just fine, but isn't really deniable since the encrypted message will have to be twice as big as any one message so it's obvious there are two messages(Unless you want to argue that it's a really crappy encryption scheme for one message ;). The issue boils down to a compression problem(Can't halve the size of the data), and is more or less acting as a form of encrypted stenography.
Comments(1)
2008-04-12 14:05:05
(2009-01-26 04:02:03) Chris Wellons said:
The only way this really works is if the algorithm is a secret, but youshouldn\'t rely on your algorithm being secret in the first place.
So assuming they know the algorithm, the only way I think this still works as a
form of plausable deniability is if you can convince the men with the rubber
hoses that the second file was a garbage file made of random values, and that
this is how you normally encrypt these sorts of things (and how you should
sometimes do it, then). When asked to provide decryption keys, you provide one
for the harmless file and a fake key. They decrpyt the harmless file, then
decrypt garbage as the second file (using the fake, garbage key).
Add your comment:
Hardware
Software
- TAIM (Alpha Version): GHCI integration with vim
- CheaTorrent -- An evil BitTorrent client
- Self Modifying 2D Turing Automata
- Competing Conway Life Automata
- X11 Timelapse Desktop Video
- Colored Wolfram Automata With Sound Input
- Pseudo Video Feedback in Processing
- Haskell Cipher Saber
- Illegal FIlenames -- Windows and *nix
- Simple Perl SDL Music Keyboard (Updated)
- Image to Spectrogram
- Pastebin Hell
- OMGWTFRNG (OWR)
- OTP Enhancement : Failure Report
- Java Network File Transfer Tool
- AES Encrypted Filesystem Speeds
- Dual Message Encryption
- PHP Website
- Mp3 Splitting Script
- Random Obfuscation Tool
- Filesystem Speed Comparisons
- Java Based Web Server GUI