Skip to content

Commit

Permalink
Update Decryption.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
sultanaalyami authored Mar 11, 2023
1 parent 7692e4d commit cb6dc8e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Decryption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public static string PayloadDecrypt(this PayloadData payload,string ClientSecret
string padding = payload.data.Replace("-", "+").Replace("_", "/");
//For correct payload decryption, create additional padding to make the payload a multiple of 4:
padding = padding.PadRight(padding.Length + (4 - (padding.Length % 4)), '=');
var decoded = padding.DecodeBase64;

// Initialization vector is the first 16 bytes of the received data
var ivScout = decoded.ToString().Substring(0, 16);
var ivScout = padding.Substring(0, 16);

// Initialization key
ClientSecret = ClientSecret.Substring(0, 16);
Expand Down

0 comments on commit cb6dc8e

Please sign in to comment.