|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
must use weak key in 3desHi,
I am trying to convert this Java code into C#: JAVA: SecretKeySpec systemKey = new SecretKeySpec("TEST KEYTEST KEYTEST KEY".getBytes(), "TripleDES"); Cipher cipher = Cipher.getInstance(DESEDE_ECB_NONE); cipher.init(Cipher.ENCRYPT_MODE, systemKey); byte[] eac = cipher.doFinal(cardRandom); //CardRandom is a byte-array I have tried various approaches, but everytime I get stuck at the same point: I am not allowed to use "TEST KEYTEST KEYTEST KEY" in TripleDES, as it is a wek key. Does anyone see how to convert the above Java-code ? I will be very thankfull ! Found the solution myself:
I need to use DES, not TripleDES. One TripleDES with "TEST KEYTEST KEYTEST KEY" is apparently the same as three DES with "TEST KEY". Logical when you think about it... Show quoteHide quote "Steen" wrote: > Hi, > > I am trying to convert this Java code into C#: > > JAVA: > SecretKeySpec systemKey = new SecretKeySpec("TEST KEYTEST KEYTEST > KEY".getBytes(), "TripleDES"); > Cipher cipher = Cipher.getInstance(DESEDE_ECB_NONE); > cipher.init(Cipher.ENCRYPT_MODE, systemKey); > byte[] eac = cipher.doFinal(cardRandom); //CardRandom is a byte-array > > I have tried various approaches, but everytime I get stuck at the same point: > I am not allowed to use "TEST KEYTEST KEYTEST KEY" in TripleDES, as it is a > wek key. > > Does anyone see how to convert the above Java-code ? > > I will be very thankfull ! > >
Anonymous access + Windows Authentication
Custom Security Permission & Security Attribute troubles X.509 "Bad Key" error - EnvelopedCms.Decrypt() RSACryptoServiceProvider Strong Names Secure??? Windows authentication only Sending raw sockets without administrative privileges? .NET 2.0: code access security / authentication Are .NET Caches Secure from Memory Dumps etc? Ensuring that calling assembly signed by certain keys |
|||||||||||||||||||||||