3DES Encryption in SWIFT or Cross Platform Method for PHP and SWIFT

I have been using Triple DES Encryption for my C# Project.I’m porting this to Mac.Is there inbuilt Triple DES Support for swift ?

This is how i use 3DES in C#

public string Decrypt3DES(string strString)
  DESCryptoServiceProvider DES = new DESCryptoServiceProvider();

  DES.Key = Encoding.UTF8.GetBytes(this.key);
  DES.Mode = CipherMode.ECB;
  DES.Padding = PaddingMode.Zeros;
  ICryptoTransform DESDecrypt = DES.CreateDecryptor();

  byte[] Buffer = Convert.FromBase64String(strString);
  return UTF8Encoding.UTF8.GetString(DESDecrypt.TransformFinalBlock(Buffer, 0, Buffer.Length));


If there is no alternative please suggest me a cross platform string encryption method that works both in PHP and SWIFT.



Powered by WPeMatico


You may also like...

Comments are closed.