0

My C# .NET 4.6 Framework Code, ChilKat (64 Bit Nuget package) works and returns an encrypted string, and when I submit it to my "black box" it tells me "Invalid padding string (or incorrect password)". The box was built in JAVA 11 years ago or so. I have no access to the box. So I guess my real question is, what might have changed over the last decade in the way this type of Encryption is created that I might have to account for when creating code today?

  Crypt2 encryptor = new Crypt2();
  encryptor.CryptAlgorithm = "3des";
  encryptor.KeyLength = 192;
  encryptor.CipherMode = "ecb";
  encryptor.RandomizeKey();
  passKey = encryptor.GetEncodedKey("base64");
  return  encryptor.EncryptStringENC(data2Encrypt);
Danimal111
  • 1,976
  • 25
  • 31
  • @dbugger - I updated the question – Danimal111 Oct 21 '16 at 15:53
  • Could be any number of things. Are you sure about the mode? The Key Length? The padding options? Is the "black box" expecting base64 encoded passwords? – dbugger Oct 21 '16 at 16:00
  • @dbugger This exact code worked at one time (with an earlier version of ChilKat... so I think the params are correct. What I don't know is if something more basic in the encryption process has fundamentally changed that would cause a change in the way the encrypted code is created. – Danimal111 Oct 21 '16 at 16:05
  • 1
    The underlying encryption algorithms don't change. That's why parameters and encoding are the likely culprits. Of course, it's possible that ChillKat is handling how it gets to and from the algorithm differently. – dbugger Oct 21 '16 at 16:15
  • @dbugger - That's what I needed to know... thanks... back to trial and error... – Danimal111 Oct 21 '16 at 16:17
  • @dbugger If you think of anything that changed in "zero padding" over the years? They tell me there is no need for a password, so it's either padding or some other parameter? Thanks again. – Danimal111 Oct 21 '16 at 16:24
  • How ChillKat works with or represents "zero padding" may have changed, but again nothing in the algo would have. – dbugger Oct 21 '16 at 16:40

0 Answers0