sbyte[] EncryptTicket() { var writer = new BigEndianWriter(); writer.WriteByte((byte)Account.Ticket.Length); writer.WriteUTFBytes(Account.Ticket); return(Array.ConvertAll <byte, sbyte>(Cryptography.AESEncrypt(writer.Data, AesKey), x => (sbyte)x)); }
public void EncryptDecrypt() { var criptAES = new Cryptography(); var plainTextEncrypted = criptAES.AESEncrypt(PLAIN_TEXT, KEY); var plainTextDecrypted = criptAES.AESDecrypt(plainTextEncrypted, KEY); plainTextDecrypted.Should().Be(PLAIN_TEXT); }