Skip to content

Commit dcc1b7e

Browse files
committed
feat: comment out byte check
1 parent c50d51e commit dcc1b7e

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

  • src/SafeCrypt.Lib/Encryption/RsaEncryption

src/SafeCrypt.Lib/Encryption/RsaEncryption/Rsa.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,23 @@ public static async Task<EncryptionResult> EncryptAsync(RsaEncryptionParameters
4141
}
4242

4343
// Convert the encrypted data to a hexadecimal string
44+
//result.EncryptedData = data.EncryptedData;
45+
//result.EncryptedData = Convert.ToBase64String(data.EncryptedData);
4446
//result.EncryptedData = BitConverter.ToString(data.EncryptedData);
45-
result.EncryptedData = Encoding.UTF8.GetString(data.EncryptedData); //Encoding.UTF8.GetString(decryptedData)
47+
//result.EncryptedData = Encoding.UTF8.GetString(data.EncryptedData); //Encoding.UTF8.GetString(decryptedData)
48+
result.EncryptedData = data.EncryptedData; //Encoding.UTF8.GetString(decryptedData)
4649
return result;
4750
}
4851

4952
public static async Task<DecryptionResult> DecryptAsync(RsaDecryptionParameters model)
5053
{
5154
var result = new DecryptionResult();
5255

53-
if (string.IsNullOrWhiteSpace(model.DataToDecrypt))
54-
{
55-
result.Errors.Add($"Data cannot be null {nameof(model.DataToDecrypt)}");
56-
return result;
57-
}
56+
//if (string.IsNullOrWhiteSpace(model.DataToDecrypt))
57+
//{
58+
// result.Errors.Add($"Data cannot be null {nameof(model.DataToDecrypt)}");
59+
// return result;
60+
//}
5861

5962
if (string.IsNullOrWhiteSpace(model.PrivateKey))
6063
{
@@ -71,8 +74,7 @@ public static async Task<DecryptionResult> DecryptAsync(RsaDecryptionParameters
7174
result.Errors.AddRange(data.Errors);
7275
return result;
7376
}
74-
75-
// convert the encrypted data to a hexadecimal string
77+
7678
result.DecryptedData = Encoding.UTF8.GetString(data.DecryptedData);
7779
return result;
7880
}

0 commit comments

Comments
 (0)