[Gambas-user] Can I encrypt a string
T Lee Davidson
t.lee.davidson at gmail.com
Wed Jul 3 13:13:26 CEST 2019
You might want to take a look at the gb.openssl component: http://gambaswiki.org/wiki/comp/gb.openssl
Or, perhaps gb.crypt if you want something simpler for passwords: http://gambaswiki.org/wiki/comp/gb.crypt/crypt
___
Lee
On 7/2/19 4:06 PM, Mayost Sharon wrote:
> hello
>
> Can I encrypt a string
>
> Such as PHP
> $plaintext = "my string sharon";
> $ivlen = openssl_cipher_iv_length($cipher="AES-128-CBC");
> $key = "mykey12345678";
> $iv = openssl_random_pseudo_bytes($ivlen);
> $ciphertext_raw = openssl_encrypt($plaintext, $cipher, $key, $options=OPENSSL_RAW_DATA,
> $iv);
> $hmac = hash_hmac('sha256', $ciphertext_raw, $key, $as_binary=true);
> $ciphertext = base64_encode( $iv.$hmac.$ciphertext_raw );
>
> thenk
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
More information about the User
mailing list