예제 #1
0
 public static string EncryptIOS(string cipherText)
 {
     try
     {
         CryptLib _crypt   = new CryptLib();
         string   strKey   = "c48ce8176ee24f809eb614d3da6be396";
         string   strInKey = "Rapid_RMS";
         String   iv       = strInKey;                           //16 bytes = 128 bits
         //String iv = CryptLib.GenerateRandomIV(16); //16 bytes = 128 bits
         string key        = CryptLib.getHashSha256(strKey, 32); //32 bytes = 256 bits
         String cypherText = _crypt.encrypt(cipherText, key, iv);
         return(cypherText);
     }
     catch
     {
         return(cipherText);
     }
 }
예제 #2
0
        public static string DecryptIOS(string cipherText)
        {
            try
            {
                string   strKey     = "c48ce8176ee24f809eb614d3da6be396";
                string   strInKey   = "Rapid_RMS";
                String   cypherText = "";
                CryptLib _crypt     = new CryptLib();
                String   iv         = strInKey;                           //16 bytes = 128 bits
                string   key        = CryptLib.getHashSha256(strKey, 32); //32 bytes = 256 bits
                cypherText = _crypt.decrypt(cipherText.Replace(" ", "+"), key, iv);

                return(cypherText);
            }
            catch
            {
                return(cipherText);
            }
        }