Article View: sci.crypt
Article #1985My encryption program. Comments?
From: Peter K. Boucher
Date: Fri, 20 Nov 1992 22:44
Date: Fri, 20 Nov 1992 22:44
43 lines
2116 bytes
2116 bytes
I wrote a stream-cipher encryption program, and I was wondering if I could get some feedback on my algorithm (no pun intended). 1) It generates a stream of pseudo-random numbers, based on a pass-phrase typed by the user (between 13 and 1019 characters). The first ~million bytes of pseudo-random numbers are generated when the program starts up. Call it "key_stream." 2) A separate, single pseudo-random byte is also generated at the start. It's value depends on generating the entire initial key_stream. Call it "zipper." 3) the program executes a loop containing the following (pseudocode) to encrypt a file: inchar = getchar(infile) outchar = inchar ^ key_stream[counter] ^ zipper <-- "^" means xor counter = counter + 1 zipper = outchar putchar(outfile, outchar) On a sparcstation, it goes through a 2 meg file a couple seconds (i.e., not appreciably) slower than %cat file > file_copy. The brute force attack would be to modify the code to only decrypt the first X bytes of the encrypted file (there's no way to generate less than the first ~million bytes of the key_stream, because the value of the zipper depends on generating all of them). Then you'd have to run the modified version against a library of pass-phrases to see if any of them produce a recognizable X bytes of plaintext. Of course, if the target knows what your value of X is, then X+1 bytes of garbage can be prepended to the plaintext before encryption, and you'll never recognize it. What other attacks might work? How can I analyze the key_stream to make sure that it's random enough (cryptographically strong)? -- Peter K. Boucher -- RIPEM public key available upon request.
Technical Details
Message-ID:
<1ejpp5INNdef@roche.csl.sri.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!nntp1.radiomail.net!csl.sri.com!boucherShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!nntp1.radiomail.net!csl.sri.com!boucher From: boucher@csl.sri.com (Peter K. Boucher) Newsgroups: sci.crypt Subject: My encryption program. Comments? Date: 20 Nov 1992 22:44:53 GMT Organization: Computer Science Lab, SRI International Lines: 43 Distribution: world Message-ID: <1ejpp5INNdef@roche.csl.sri.com> NNTP-Posting-Host: affirmed.csl.sri.com