Skip to content

Commit

Permalink
Update ComputePasswordHash and VerifyPassword
Browse files Browse the repository at this point in the history
  • Loading branch information
artemlos committed Oct 17, 2022
1 parent d0edcd3 commit e562ef8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Company>Cryptolens AB</Company>
<Authors>Cryptolens AB</Authors>
<Version>4.0.38</Version>
<AssemblyVersion>4.0.38.1</AssemblyVersion>
<FileVersion>4.0.38.1</FileVersion>
<Version>4.0.39</Version>
<AssemblyVersion>4.0.39.1</AssemblyVersion>
<FileVersion>4.0.39.1</FileVersion>
<Description>An API documentation can be found at https://help.cryptolens.io/api/dotnet/.

This is a client API that serves as an interface to Cryptolens Web API (app.cryptolens.io/docs/api/).
Expand Down
6 changes: 3 additions & 3 deletions Cryptolens.Licensing/Cryptolens.Licensing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Company>Cryptolens AB</Company>
<Authors>Cryptolens AB</Authors>
<Version>4.0.38</Version>
<AssemblyVersion>4.0.38.1</AssemblyVersion>
<FileVersion>4.0.38.1</FileVersion>
<Version>4.0.39</Version>
<AssemblyVersion>4.0.39.1</AssemblyVersion>
<FileVersion>4.0.39.1</FileVersion>
<Description>An API documentation can be found at https://help.cryptolens.io/api/dotnet/.

This is a client API that serves as an interface to Cryptolens Web API (app.cryptolens.io/docs/api/).
Expand Down
4 changes: 2 additions & 2 deletions Cryptolens.Licensing/SKMv3/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public static bool VerifyPassword(LicenseKey license, string username, string pa
} catch (Exception ex) { return false; }

byte[] decodedSalt = Convert.FromBase64String(passwordsalt[0]);
byte[] decodedPassword = Convert.FromBase64String(passwordsalt[1]);
//byte[] decodedPassword = Convert.FromBase64String(passwordsalt[1]);

return ComputePasswordHash(password, decodedSalt) == activation.Mid;
}
Expand Down Expand Up @@ -123,7 +123,7 @@ public static string ComputePasswordHash(string password, byte[] salt = null)
var saltUsed = Convert.ToBase64String(rfc2898.Salt);
var passwordHash = Convert.ToBase64String(rfc2898.GetBytes(32));

return Convert.ToBase64String(new UTF8Encoding().GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(new string[] { saltUsed, password })));
return Convert.ToBase64String(new UTF8Encoding().GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(new string[] { saltUsed, passwordHash })));
}


Expand Down

0 comments on commit e562ef8

Please sign in to comment.