0

Recently a new project is assigned to me and its developed in ages old VB.net technology. Initially it was not even building with some error in licenses.licx file. I have removed all content from licenses.licx, the project is now building and i can debug and test most of the part, but the code exits with stack overflow exception while decrypting a string. this line

Dim userName As String = clsCrypto.Decrypt("encryptedstringUserName==")
Dim Password As String = clsCrypto.Decrypt("encryptedstringPassword==")

I have searched a lot but still unable to figure out how clsCrypto is working and why its throwing stackoverflow exception. Also i am unable to find any certificate or other encryption decryption key. A help or point to correct direction will definitely make my day.

PS. The developer has already left and no one has any idea about how this thing is working.

enter image description here

uddi baba
  • 135
  • 2
  • 13
  • Are you able to view the stack trace from the exception to see what's referencing itself recursively? – David Mar 08 '23 at 12:49
  • "Exception of type system.stackoverflowException is thrown" . nothing else. I have also updated question – uddi baba Mar 08 '23 at 12:52
  • Which Bouncy Castle are you using? The legacy one (https://www.nuget.org/packages/BouncyCastle) or the new one (https://www.nuget.org/packages/BouncyCastle.Cryptography/)? Might be worth to swap out one for the other and try it. – Hel O'Ween Mar 08 '23 at 13:21
  • using legacy one. Tried to switch to bouncycastle.cryptography but clsCrypto is not available in it – uddi baba Mar 08 '23 at 15:28
  • See if this helps: https://stackoverflow.com/questions/73817567/bouncy-castle-encrypt-and-decrypt-password-org-bouncycastle-crypto-invalidciph – Hel O'Ween Mar 08 '23 at 15:59
  • Are you sure clsCrypto isn't a defined instance of some bouncycastle object type? If you right click on it and got to View Declaration, what happens? – Hursey Mar 08 '23 at 19:57

0 Answers0