Thread View: comp.security.unix
2 messages
2 total messages
Started by Administrator
Sun, 27 Sep 1998 00:00
Does SSLeay's libcrypto have problems ?
Author: Administrator
Date: Sun, 27 Sep 1998 00:00
Date: Sun, 27 Sep 1998 00:00
54 lines
3062 bytes
3062 bytes
I was having my first look at libcrypto that comes with SSleay on the linux platform. The RC2 and RC4 ciphers do not work, at least not as said in the documentation. For example the RC4 cipher does not work as directed. there are just two functions here RC4_set_key and RC4. Now the documentation does say that the key must be set everytime you do the encryption. But this does not work. I had to lok at the rc4.h file and replace the two int members in the RC4_KEY manually to zero. Then I started to read x bytes from a file and do: read x bytes from file into in RC4(key,x,in,out) do key reset and zero setting as mentioned above RC4(key,x,out,out1) I collected the results into the results into a file and compared it with the original file. This only worked with a files. It did not work when I tried it with some some zip and binary files (basically). Observe that the second time I use RC4 to decrypt I use x as the length not the length of out. When I tried using the length of "out" the second time instead of x the process never worked. This latter approach is what the documentation seems to suggest. There were instances where the length of "in" and "out" were not the same and infact with what I saw length(in) >= length(out). Now this is a stream cipher right ? How do I output the encrypted stream ? With the lengths used in the original encrypt ? The approach I tried failed completely when I stopped the immediate decryption and tried to save the encrypted data to a file and then decrypting it. And lastly assuming that I do find a solution how do you work with binary files ? Do uuencode or something ? RC2 can be used similarly in cbc64 mode as per the documentation. The documentation of these routines actually gives less information than the header files themselves. I would greatly appreciate it if someone replies and guides me. Thanx -tl201
Re: Does SSLeay's libcrypto have problems ?
Author: T. Youderian
Date: Wed, 07 Oct 1998 00:00
Date: Wed, 07 Oct 1998 00:00
31 lines
2522 bytes
2522 bytes
Administrator wrote: > I was having my first look at libcrypto that comes with SSleay on the > linux platform. The RC2 and RC4 ciphers do not work, at least not as > said in the documentation. > There were instances where the length of "in" and "out" were not the > same and infact with what I saw length(in) >= length(out). > > Now this is a stream cipher right ? How do I output the encrypted stream > > ? With the lengths used in the original encrypt ? Hrm, well RC2 and RC4 are message digests, which means that for a great big huge piece of information, you can make a kind of crypto-fingerprint for it. Then, if someone were to modify the file, the new digital fingerprint should be very different. It's not exactly an encryption of the data, it's more like a "summary"? Does that help? The Enigma machine used a stream cipher and Skipjack is a stream cipher. I should go look at the SSLeay source, but surely it has some other functions for doing the actual crypto.. you are going to want to look around for functions that pass around the session key (Diffie-Hellman) and then from there, go on and encrypt the rest of the connection with some less powerful cipher like DES or whatever. Post to sci.crypto? Crypto is definitely one of those things where a little knowledge is a bad thing and I'm no expert. Tom
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads