Skip to content

Commit 14959be

Browse files
authored
Update EXAMPLES.md
1 parent dec8f23 commit 14959be

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

docs/EXAMPLES.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@
88
| [CAS AES-256](https://github.com/Cryptographic-API-Services/cas-dotnet-sdk/blob/main/cas-dotnet-sdk/Symmetric/AESWrapper.cs) | 00.0068827 (s) |
99
| [AES C#](https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.aes?view=net-8.0)| 00.0079577 (s) |
1010
```csharp
11+
using CasDotnetSdk.Symmetric;
12+
1113
AESWrapper aesWrapper = new AESWrapper();
1214
byte[] nonceKey = aesWrapper.GenerateAESNonce();
13-
string key2 = aesWrapper.Aes256Key();
14-
byte[] encrypted = aesWrapper.Aes256EncryptBytes(nonceKey, key2, data);
15+
byte[] key2 = aesWrapper.Aes256Key();
16+
byte[] data = System.Text.Encoding.UTF8.GetBytes("Hello World");
17+
byte[] encrypted = aesWrapper.Aes256Encrypt(nonceKey, key2, data);
1518
```
1619

1720

@@ -136,3 +139,4 @@ byte[] plaintext = this._hybridEncryptionWrapper.DecryptAESRSAHybrid(initializer
136139
```
137140

138141

142+

0 commit comments

Comments
 (0)