The AES-256 (CBC) encryption we apply here works as follows:
AES-256 requires a key of exactly 32 bytes (256 bits) and an IV of exactly 16 bytes (128 bits). Since the supplied key and IV can be of any length, they are first hashed with SHA-256 to guarantee the correct size.
The encryption is performed entirely in the browser using the Web Crypto API. No data is sent to a server.
Note: spaces and the like at the beginning and end of the entry are not removed and are therefore important for successful decryption!
In cryptography, Advanced Encryption Standard (AES) is a computer encryption technology. It is the successor to the "Data Encryption Standard" (DES). AES is a subset of the Rijndael algorithm where the block size is 128-bit, and the key 128, 192 or 256 bits. Rijndael itself can all block sizes and keys that are a 32-bit multiplication with a minimum of 128-bit and a maximum of 256-bit.
Source: Wikipedia
<?php
$key = 'my secret key'; // encryption key
$iv = 'my initialisation vector'; // initialisation vector
$text = 'This is a text'; // plain text to encrypt
// derive 256-bit key from SHA-256 hash
$keyHash = hash('sha256', $key, true);
// derive 128-bit IV from SHA-256 hash (first 16 bytes)
$ivHash = substr(hash('sha256', $iv, true), 0, 16);
// encrypt text
$result = openssl_encrypt($text, 'aes-256-cbc', $keyHash, OPENSSL_RAW_DATA, $ivHash);
// result contains binary string, convert to
// ASCII using base64 encoding
$result = base64_encode($result);
// $result now contains string:
// e.g. 'dGVzdA==' (actual value depends on input)
Call now +31207775488 if you need another tool!