Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

SRP_Hash on Large Strings

Since updating my SRP Utils on my development system to go along with the new editor SRP_Hash with the SHA-2 hash algorithm is giving me different results than the old version for large strings. Do you happen to know if something was changed?

I use the SRP_Hash on BASE64 encoded images so the strings can be quite large but the hashes were reliable, and they still are on smaller files/strings but larger files (I don't have a specific cutoff) have changed since updating to the newest version of Utils.

Comments

  • It appears that the issue I'm having is actually in the SRP_Encode function and not Hash, prior to the change the Encode function was inserting a CRLF every 77 characters, now it is inserting a CRLF every 73. I'm going to guess that this isn't actually a bug and the intended use.
  • The CRLF is not data. It's just there to make it pretty when sending BASE64 over a wire. If you're going to hash a BASE64 string, you should encode it without CRLFs. SRP_Encode has an Option parameter that you can set to 0 to do this for you.
  • Thanks Kevin, I did find that option, this was in a section of code that I don't think I've looked at in some 7 years so it's been a while.
Sign In or Register to comment.