Re: Linux can't decrypt cipher text created under Windows



danmez@xxxxxxxxx wrote:
at least it seems so. Although I'm a newbie to crytpo, so I'm not
sure.

The actual goal is to write DES decryption code in C to run on a 16
bit micro controller with no OS. This controller will then decrypt
messages encrypted by the Win/DOS exe. I don't have src code to the
Win/Dos exe but know it's doing single DES in ECB mode.

I have working controller code that encrypts and decrypts messages but
I can't decrypt a message encrypted by the Windows/DOS tool.
Furthermore, I wrote a test program under Linux, to make use of the
ecb_crypt() DES library call, but neither my code or the Win/DOS tool
agree with the Linux version. All three seem to encrypt and then
decrypt it's own, but just can't decrypt the other's encrypted data.
I just try on 64 bit plain text messages(like 0x0101010101010101) with
the same key.

So how can these 3 different encryption programs be correct but yet
disagree with each other(produce different cipher text)? From the
definition of DES in the FIPS Publication 46-3, Appendix 1 gives a
"recommended set" of selection functions.

Is it possible Windows and Linux libraries use different selection(S-
Box) functions? Which are both different from what is defined in FIPS
Publication 46-3? But I did google searches and didn't see anyone
else with this problem. I'm confused.

Any feedback would be appreciated!
Thanks,
Dan


Two possibilities not yet mentioned.

Some software reformats the data for the s-boxes into a more "friendly" format for arrays - there is plenty of room for errors there.

Some (most?) software versions of DES do not included the initial and final bit permutations. The resulting cipher is as strong as DES but is not compatible.

Good luck
.



Relevant Pages

  • Linux cant decrypt cipher text created under Windows
    ... Win/Dos exe but know it's doing single DES in ECB mode. ... I have working controller code that encrypts and decrypts messages but ... I can't decrypt a message encrypted by the Windows/DOS tool. ... Furthermore, I wrote a test program under Linux, to make use of the ...
    (sci.crypt)
  • Re: Encrypt and Decrypt a file using .NET 2.0?
    ... public static string GenerateKey() ... DES des = DES.Create; ... // Distribute this key to the user who will decrypt this file. ... // Get the Key for the file to Encrypt. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Silly beginner questions
    ... A has a message composed by, let's say, N uppercase letters. ... It encrypts it and send it to B, ... Since both DES and RSA are over thirty years old, ... RSA had no limit on the length of the composite when it was invented. ...
    (sci.crypt)
  • Re: In Search for the Proper Crypto System
    ... You want 'C1' to be able to decrypt 'd' on permission from 'A', ... > text always encrypts to the same ciphertext, then I can just quiz the ... > about, transmitting the plain text would not be practical for the cheater, ... > but publishing a symetric key would be for later download and decryption. ...
    (sci.crypt)
  • Re: Can he sue?
    ... hardware-based key which is required to decrypt the data. ... that s/he encrypts it is hardly likely to risk losing it by creating ... allows an encrypted container to be hidden within another encrypted ...
    (uk.legal)

Quantcast