Exemple #1
0
 /// <summary>
 /// Decrypt method implementation
 /// </summary>
 public override string Decrypt(string data)
 {
     try
     {
         byte[] Hdr = GetHeader(Convert.FromBase64String(data));
         if (Hdr.SequenceEqual(new byte[] { 0x17, 0xD3, 0xF4, 0x2A }))
         {
             using (AES256SystemEncryption enc = new AES256SystemEncryption())
             {
                 return(enc.Decrypt(data));
             }
         }
         else if (Hdr.SequenceEqual(new byte[] { 0x17, 0xD3, 0xF4, 0x29 })) // For compatibility Only
         {
             using (AES128SystemEncryption enc = new AES128SystemEncryption())
             {
                 return(enc.Decrypt(data));
             }
         }
         else
         {
             return(data);
         }
     }
     catch
     {
         return(data);
     }
 }
Exemple #2
0
 /// <summary>
 /// Encrypt method implementation
 /// </summary>
 public override byte[] Encrypt(byte[] data)
 {
     try
     {
         using (AES256SystemEncryption enc = new AES256SystemEncryption())
         {
             return(enc.Encrypt(data));
         }
     }
     catch
     {
         return(data);
     }
 }
Exemple #3
0
 /// <summary>
 /// Encrypt method implementation
 /// </summary>
 public override string Encrypt(string data)
 {
     try
     {
         using (AES256SystemEncryption enc = new AES256SystemEncryption())
         {
             return(enc.Encrypt(data));
         }
     }
     catch
     {
         return(data);
     }
 }