Jump to content

digitallabs

New Members
  • Posts

    1
  • Joined

  • Last visited

digitallabs's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi there I normally code PHP, but I'm no encryption expert. My friend has asked me to encrypt a string using PHP so that: Encryption keystring : BinHex Encoder for Data UTF8 Encoder for KeyString KeyArrayLength : 16 - KeyString is converted to byteArray using UTF8 encoder and then the result byteArray is trimmed upto 16 length (i.e KeyArrayLength) SaltString = Encryption keystring SaltString Length = 16 KeySaltTextEncoder = UTF8 Initialization Vector = Salt (Salt is obtained by converting Saltstring to byteArray using UTF8 encoder and then the result byteArray is trimmed upto 16 length i.e. SaltString length) Uses the RijndaelManaged implementation KeySize : 256 BlockSize : 128 Mode : Cipher Block Chaining (CBC) Padding : PaddingMode.PKCS7 I don't understand the English part, so how to do it in PHP? Ideally I need a function where I can feed my string and the key that he supplied which has 44 characters in length. So far I have this:mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $the_raw_key, $str, MCRYPT_MODE_CBC, $the_raw_key); (it doesn't work, but even if it did work doesn't mean I'm doing the right thing) My friend will decrypt the information and the decryption needs to work without too many code changes on the encryption side. Hope someone can help me! Many thanks in advance!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.