Skip to content

Commit

Permalink
made nullable decrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
Haik committed Nov 23, 2023
1 parent 39b3b0d commit 27f9532
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Pandatech.Crypto/Aes256.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ public byte[] Encrypt(string? plainText, string key, bool addHashToBytes = true)
return addHashToBytes ? EncryptWithHash(plainText, key) : Encrypt(plainText, key);
}

public string? Decrypt(byte[] cipherText, bool includesHash = true)
public string? Decrypt(byte[]? cipherText, bool includesHash = true)
{
if (cipherText.Length == 0) return "";
if (cipherText == null || cipherText.Length == 0) return "";
return includesHash ? DecryptIgnoringHash(cipherText) : Decrypt(cipherText);
}

public string? Decrypt(byte[] cipherText, string key, bool bytesIncludeHash = true)
public string Decrypt(byte[] cipherText, string key, bool bytesIncludeHash = true)
{
ValidateKey(key);
if (cipherText.Length == 0) return "";
Expand Down
4 changes: 2 additions & 2 deletions Pandatech.Crypto/Pandatech.Crypto.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>2.2.0</Version>
<Version>2.2.1</Version>
<Title>Pandatech.Crypto</Title>
<Authors>Pandatech</Authors>
<PackageIcon>pandatech.png</PackageIcon>
<PackageReadmeFile>Readme.md</PackageReadmeFile>
<Description>PandaTech.Crypto is a .NET library simplifying common cryptograhic functions.</Description>
<RepositoryUrl>https://github.com/PandaTechAM/be-lib-pandatech-crypto</RepositoryUrl>
<PackageReleaseNotes>.net 8.0 update</PackageReleaseNotes>
<PackageReleaseNotes>Nullable byte in aes256 decrypt</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 27f9532

Please sign in to comment.