forked from Watfaq/SoftU2F-Win
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProgram.cs
30 lines (27 loc) · 772 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.Security.Cryptography;
namespace JustTest
{
class Program
{
static void Main(string[] args)
{
var data = new byte[]{1,2,3};
var s = ProtectedData.Protect(data, null, DataProtectionScope.CurrentUser);
Console.WriteLine("encrypted");
foreach (var b in s)
{
Console.Write(b);
Console.Write(",");
}
var ss = ProtectedData.Unprotect(s, null, DataProtectionScope.CurrentUser);
Console.WriteLine("Unencrypted");
foreach (var b in ss)
{
Console.Write(b);
Console.Write(",");
}
Console.ReadLine();
}
}
}