I’m writing a C# frontend to a legacy database that uses VB6 Rnd() and Randomize() methods for user password encryption. The encryption function is very simplistic and really not all that secure, but it’s what all current passwords are stored with.
What I’d like to be able to do is authenticate legacy users from a C# application. I can write new encryption (or preferably hashing) code for VB6 so that all future users have a more secure password, and that can be duplicated in C#. But I don’t want to require current users to have had their password reset before they can use the new frontend.
Is there any way I can reimplement that algorithm in C# so that it produces identical results to the legacy VB6 code?
You can generate the same sequence from VB6 and C#. Just watch our for rounding errors (the results from C# are more precise). Make sure to call
VBMath.Rnd(-1)before passing in a new seed toVBMath.Randomize().