Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Privacy without Encryption

by arhuman (Vicar)
on Jun 04, 2001 at 12:38 UTC ( [id://85426]=perlmeditation: print w/replies, xml ) Need Help??

I'd like to talk about an old but unknown way to achieve privacy without encryption.
This method is another gift from R. RIVEST
(You know the 'R' in RSA, RC4, RC6 and MD5 ;-)

The basic Idea is to hide valid data (the wheat) in a lot of useless data (the chaff).
I've read once somebody talking about his scheme as a kind of textual steganography,
I think the 'picture' (is there a better word for a comparison with steganography ;-)
is quite true.

Note : Please feel free to comment/correct this code(beware it's an alpha release, not so tested) after reading this post

How does it work ?

Let's say you have a message to transmit

PlainText="hello"

you split it in several parts 'h','e','l','l','o'
then you make packet with these parts :

(1,'h',CHECKSUM('h'+privatekey))
(2,'e',CHECKSUM('e'+privatekey))
(3,'l',CHECKSUM('l'+privatekey))
(4,'l',CHECKSUM('l'+privatekey))
(5,'o',CHECKSUM('o'+privatekey))

You can see that the packet are made of 3 parts :
  1. the sequence number.
  2. the message.
  3. the checksum of the message and a secret key
    (this part will be used for authentication)

then you add chaffs, ie false packets.

(1,'r',CHECKSUM(random))
(1,'f',CHECKSUM(random))
(1,'z',CHECKSUM(random))
(1,'d',CHECKSUM(random))
(1,'t',CHECKSUM(random))
(2,'g',CHECKSUM(random))
(2,'z',CHECKSUM(random))
(2,'l',CHECKSUM(random))
(2,'m',CHECKSUM(random))
(2,'n',CHECKSUM(random))
(3,'r',CHECKSUM(random))
(3,'f',CHECKSUM(random))
(3,'z',CHECKSUM(random))
(3,'d',CHECKSUM(random))
(3,'t',CHECKSUM(random))
(4,'g',CHECKSUM(random))
(4,'h',CHECKSUM(random))
(4,'q',CHECKSUM(random))
(4,'e',CHECKSUM(random))
(4,'f',CHECKSUM(random))
(5,'W',CHECKSUM(random))
(5,'y',CHECKSUM(random))
(5,'z',CHECKSUM(random))
(5,'p',CHECKSUM(random))
(5,'v',CHECKSUM(random))

You send all those packets (after shuffling them)
The receiver who knows the private key check each packet
by calculating the CHECKSUM hash of the second value+the private key
and by compairing with the third value.
Either it's a match and the receiver knows it's a good packet,
and the first value show its position.
Either there's no match and it's a chaff that must be dropped.

Rivest use through his article the terms :
  • Chaffing for the encryption process when you add random data.
  • Winnowing for the decryption process when you sort out the data (wheat) out of the chaff.

Easy, isn't it ?

Ok may be too easy, probably even your little sister would be able to spot the wheat out of the chaff with example trivial like these.
And in more complex example when your data payload is bigger, it's even easier to distinguish true data (parts of the message) and chaff (random data).
Moreover there are trivial attack which could be lead using already guessed data to lead on further the cryptanalisis of this scheme using probability, dictionnary attack...
That's why RIVEST suggest to use and all-or-nothing encoding on the payload.

Now I hear you asking, why should I use this new scheme ?
  • This can't be used for public key exchange (Further more RSA rules in that field)
  • There are tons of excellent(faster with better plaintext/ciphertext ratio) RC6,Rijndael,Twofish....
You are right on this 2 point (although I think that wiht few work we could use this scheme with public keys).
However this scheme has several funny advantages :

  • You can use it to achieve privacy WITHOUT encryption (usefull in some countries)
  • This scheme is especially efficient when a lot of data are multiplexed.
  • You could use a really useful feature which I'll call 'fake decryption' (Rivest uses 'denial encryption') to make people believe that they deciphered the text
Let's explain it a little bit more.

Encryption without privacy

The funny thing is that, as data aren't encrypted, this scheme is legal even in country where encryption isn't.
(technically speaking there's only authentication !)
I'd like you to refer to the original paper for a detailed explanation on this.

Multiplexing ready

The big drawback of this scheme is his plaintext/ciphertext (again I must stress that ciphertext isn't the appropriate word here, as there is no ENCRYPTION, I should use encodedtext but this word is never used ;-)
Now imagine several people send messages at the same time on the same canal, each 'wheat' is 'chaff' for the other messages !
The more people are sending messages the less you need random faked data.
will you recognize the easy 3 messages crafted without any random data here :

(1,m,checksum)
(1,f,checksum)
(1,h,checksum)
(2,o,checksum)
(2,o,checksum)
(2,e,checksum)
(3,n,checksum)
(3,l,checksum)
(3,l,lhecksum)
(4,k,ckecksum)
(4,k,checksum)
(4,l,checksum)
(5,s,checksum)
(5,o,checksum)
(5,s,checksum)

Some of you should have guessed 'monks' 'hello' 'folks'.
Now imagine I multiplex 3 or 4 other messages are you confident about your ability to succed to decrypt one ?
(corrolary question will you be sure that the guess message will be a REAL one ?)
(corrolary question2 what if I use a all-or-nothing encoding ?)

Fake decryption

I really like this feature.
Just imagine that you mix 2 differents messages (using 2 differents key for authentication) and use the chaff.
(One explaining to your buddy how you have managed to crack some B1 computers of the government, another saying how you love the wise governement...)
Now Mr SMITH from the NSA knock on your door saying :
"hey guy give me your key to decipher this message (it's not enciphered but you know the NSA is not so used with crypto stuff ;-)
otherwise I sue you for terrorism !"
in this case you'll give him the key enabling him to get the message telling how much you love the governement...
(without the other key all the other 'wheat' is only apparent 'chaff'...
In all other situation your buddy will probably use the right key to decipher the message and play with the B1 computers ;-)

There is really a lot to say about this scheme.
And I'd like to get your feedback about some points (or other I may have missed)
  • First what do you think about it ?
  • I didn't get the article about the all-or-nothing transform, so in my implemenatation I used a reversed compression as encoding. Is it correct ? If it's flawed how could I correct ?
  • What attacks can be mounted against this scheme ?
  • I thought about one improvement to enhance the signal/noise ratio.
    I'd suggest to not store the sequence number in the cipher text but use it to compute the checksum.
    Cryptanalisis is now MUCH harder ans you need less chaff...
    As a drawback the decryption process will be slower (as we'll have to 'guess' the sequence number)
    With the key a rough estimate of the complexity for decoding would be O(N*N) without a key a brute for would be O(N!)...
    (There is even an interesting extreme scenario with no chaff -> the algo would be a kind of shuffling scheme)
    However I wonder if it isn't encryption now...
  • The first implementation of my prog is quite simple, and some problem needs better handling ( By example, loading all the files in memory only allow me to process only small files)
  • How to compute the *best* packet size ?


Credits :

-The Napalm Zine where I first hear about this scheme.
Hi kynik ! Thanx for your great article !!!

-Chaffing and Winnowing: Confidentiality without Encryption
The original article from Rivest.

-The Checksum Team
Who convinced me to write this article, and help me to enhance my security skill...

"Only Bad Coders Code Badly In Perl" (OBC2BIP)

Replies are listed 'Best First'.
Re: Privacy without Encryption
by ZZamboni (Curate) on Jun 04, 2001 at 17:59 UTC
    Thank you for the very interesting post. I have always thought this Chaffing and Winnowing technique is very neat :-)

    A few years ago I wrote a class project using this, for a "Security and Cryptography" class. I had never thought about it again until I saw your post today, but here it is, complete with code, documentation and the report that accompanied it. If you look at it, please be kind with both my code and my prose: they were written a few years ago, under a looming deadline and probably with very little sleep :-) But I even implemented a client-server version of the thing...

    --ZZamboni

      Thanx ! I'll try to dig in your code which is quite impressive and rather 'dense'...

      I'm a little bit disapointed to see that you're the only one who made a comment.
      (That's another good reason to thanks you !)

      Usually I would have thought that my post was uninteresting, but as I got many XP for it,
      the only reason I can imagine for having no answer is that most of you don't dare to correct me
      (As I KNOW that these code/post are FAR from perfect...)

      Go on ! Make you comments ! The code is buggy ! The implementation MUST be enhanced !
      Whatever your rank, skill you probably have something to say !
      Please read Stubborn as a Saint and reply !
      I'd be really glad to be corrected or read ANY comment, suggestion or request for an explanation...

      "Only Bad Coders Code Badly In Perl" (OBC2BIP)
Re: Privacy without Encryption
by one4k4 (Hermit) on Jun 05, 2001 at 16:57 UTC
    Maybe I need to get into this a bit more, but well.. hence the comment. :)

    Just a curiosity more than anything else... but when you mentioned multiple messages adding more and more chaff to help hide the 'real' messages, would there be any problems if two people choose the same key? Or if the random number generated == private key?

    I suppose I should read up on this more, as once again, arhuman has written something that perks my interest in the world of crypto.

    Anyway, nice node...

    _14k4 - webmaster@poorheart.com (www.poorheart.com)
      You're totally right !
      If 2 people use the same key we could have a problem...

      But the probability to have 2 people using the same key at the same time on the same channel should be negligeable...
      (furthermore my with my implementation this would be detected by a decompression error)
      In the same way the probability to generate a random packet with a valid checksum exists but is so low, that it could be ignored
      (However a robust implementation could test it easily at packet generation time...)


      "Only Bad Coders Code Badly In Perl" (OBC2BIP)
Re: Privacy without Encryption
by Anonymous Monk on Jun 17, 2004 at 17:21 UTC
    Hi arhuman! Glad to hear that somebody got something out of Napalm! Kynik (kynik@osuny.co.uk)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://85426]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-26 04:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found