Skip to content

Commit 0fd1ed9

Browse files
committed
Restructure encrypt class
1 parent fe96242 commit 0fd1ed9

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Encrypt/AesEncryption/Encrypt.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System.IO;
2+
using System.Security.Cryptography;
3+
4+
namespace SafeCrypt
5+
{
6+
public class Encrypt : BaseAesEncryption
7+
{
8+
public byte[] AesEncrypt(byte[] data, byte[] key, byte[] iv)
9+
{
10+
return EncryptAES(data, key, iv);
11+
}
12+
13+
public string AesEncryptByteToHex(byte[] data, byte[] key, byte[] iv)
14+
{
15+
var cipherText = EncryptAES(data, key, iv);
16+
17+
return cipherText.ByteArrayToHexString();
18+
}
19+
20+
public string AesEncryptByteToBase64(byte[] data, byte[] key, byte[] iv)
21+
{
22+
var cipherText = EncryptAES(data, key, iv);
23+
24+
return cipherText.ByteArrayToHexString();
25+
}
26+
27+
//public byte[] AesEncrypt(byte[] data, byte[] key, byte[] iv, ReturnType returnType)
28+
//{
29+
30+
//}
31+
}
32+
}

0 commit comments

Comments
 (0)