#1 2017-01-05 11:29:59

RF99
Member
Registered: 2017-01-05
Posts: 1

SynCripto DES

I has looking at SynCripto to see if it implements DES algorithm.

I need to find a vcl code to encrypt strings that is compatible is this c# source code:

public static string encrypt(string value, string key)

        {

            DESCryptoServiceProvider des = new DESCryptoServiceProvider();

            des.Mode = CipherMode.CBC;

            des.Padding = PaddingMode.PKCS7;

            des.Key = ASCIIEncoding.ASCII.GetBytes(key);

            des.IV = ASCIIEncoding.ASCII.GetBytes(key);



            ICryptoTransform encryptor = des.CreateEncryptor();

            byte[] messageBytes = System.Text.ASCIIEncoding.ASCII.GetBytes(value);

            byte[] encryptedBytes = encryptor.TransformFinalBlock(messageBytes, 0, messageBytes.Length);



            return Convert.ToBase64String(encryptedBytes);

        }

Example:

calling with encrypt(“1234568”, "c9FC57w3");

I should have bVRN+cnpPLvpJkRE+W5+JQ==


Thank you

Offline

#2 2017-01-05 18:46:41

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,649
Website

Re: SynCripto DES

No, SynCrypto does not support DES.

It is now a deprecated algorithm, which should be replaced by something stronger, e.g. AES - which is implemented in SynCrypto.

Offline

Board footer

Powered by FluxBB