Jump to content

Recommended Posts

Posted

#include <Crypt.au3>

Global $key = "91305D1C12D802F2DFDC946DEF7C1363"
Global $name = "john"

$crypted_name = _Crypt_EncryptData($name, $key, $CALG_AES_256)
MsgBox(0,"Encrypted", $crypted_name)

$real_name = _Crypt_DecryptData($crypted_name, $key, $CALG_AES_256)
MsgBox(0,"Decrypted", $real_name) ; the real name should be "john"

anyone please tell me how to solve this. :)

Posted

Re-read the help file again as you will notice you're missing the use of BinaryToString.

#include <Crypt.au3>

Local $sKey = '91305D1C12D802F2DFDC946DEF7C1363'
Local $sName = 'john'

_Crypt_Startup()

Local $bEncrypted = _Crypt_EncryptData($sName, $sKey, $CALG_AES_256)
MsgBox(4096, 'Encrypted', $bEncrypted)

Local $bDecrypted = _Crypt_DecryptData($bEncrypted, $sKey, $CALG_AES_256)
Local $sDecrypted = BinaryToString($bDecrypted)
MsgBox(4096, 'Decrypted', $sDecrypted)

_Crypt_Shutdown()

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...