Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
working aes encryption/decryption
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.Security.Cryptography; using System.Text; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here var pomocna = new Program(); var text = pomocna.Encryptxx("87bdd7da-f8e8-42d9-9bef-c08d67ed4d5621AWGHHXTM0X"); Console.WriteLine("vysledok = " + text); var text3 = pomocna.Decryptxx(text); Console.WriteLine("vysledok = " + text3); } public string Encryptxx(string text) { byte[] src = Encoding.UTF8.GetBytes(text); byte[] key = Encoding.ASCII.GetBytes("0123456789abcdef"); RijndaelManaged aes = new RijndaelManaged(); aes.Mode = CipherMode.ECB; aes.Padding = PaddingMode.PKCS7; aes.KeySize = 128; using (ICryptoTransform encrypt = aes.CreateEncryptor(key, null)) { byte[] dest = encrypt.TransformFinalBlock(src, 0, src.Length); encrypt.Dispose(); return Convert.ToBase64String(dest); } } public string Decryptxx(string text) { byte[] src = Convert.FromBase64String(text); RijndaelManaged aes = new RijndaelManaged(); byte[] key = Encoding.ASCII.GetBytes("0123456789abcdef"); aes.KeySize = 128; aes.Padding = PaddingMode.PKCS7; aes.Mode = CipherMode.ECB; using (ICryptoTransform decrypt = aes.CreateDecryptor(key, null)) { byte[] dest = decrypt.TransformFinalBlock(src, 0, src.Length); decrypt.Dispose(); return Encoding.UTF8.GetString(dest); } } } }
run
|
edit
|
history
|
help
0
Game 1.0.4
dima
2 point gradient (v2)
ssz
Find the missing number in an array1
Programa_01_01_Declaracion_de_clases
ASCII table generator
abcd
Fórum ➡ DataTable #1's rows that are NOT present in DataTable #2 ♦
Basic