CodeIgniter Forums
How encrypt with vector - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: How encrypt with vector (/showthread.php?tid=75345)



How encrypt with vector - omid_student - 01-28-2020

Hi
I use encryption library with AES cipher
I need encrypt my data with vector but this library dont have any field or method about vector
Please help me


RE: How encrypt with vector - InsiteFX - 01-29-2020

What library are you using? OpenSSL can use a vector IV.


RE: How encrypt with vector - omid_student - 01-29-2020

(01-29-2020, 03:29 AM)InsiteFX Wrote: What library are you using? OpenSSL can use a vector IV.
Encryption library
I use openSSL but this library dont have any properties or method for vector


RE: How encrypt with vector - InsiteFX - 01-29-2020

OpenSSL creates the IV vector like this:

iv = initialization vector

PHP Code:
$iv openssl_random_pseudo_bytes(openssl_cipher_iv_length('AES-256-CBC')); 

openssl_cipher_iv_length


RE: How encrypt with vector - omid_student - 01-30-2020

(01-29-2020, 09:08 AM)InsiteFX Wrote: OpenSSL creates the IV vector like this:

iv = initialization vector

PHP Code:
$iv openssl_random_pseudo_bytes(openssl_cipher_iv_length('AES-256-CBC')); 

openssl_cipher_iv_length
I know it but how do i use it in codeigniter encryption library?


RE: How encrypt with vector - InsiteFX - 01-30-2020

Make sure that you are using the library version it has OpenSSL driver.

From viewing the library they are doing the vector using the key.

PHP Code:
$key openssl_random_pseudo_bytes($length$is_secure); 

As you can see above.

The vector is from what I read just the length of the key.


RE: How encrypt with vector - omid_student - 01-30-2020

(01-30-2020, 05:31 AM)InsiteFX Wrote: Make sure that you are using the library version it has OpenSSL driver.

From viewing the library they are doing the vector using the key.

PHP Code:
$key openssl_random_pseudo_bytes($length$is_secure); 

As you can see above.

The vector is from what I read just the length of the key.

Doesn't the vector contain a series of characters?
Do you can give me sample for use vector?
Thanks


RE: How encrypt with vector - InsiteFX - 01-30-2020

This is how it works from php.net

openssl_encrypt


RE: How encrypt with vector - omid_student - 01-30-2020

(01-30-2020, 01:03 PM)InsiteFX Wrote: This is how it works from php.net

openssl_encrypt
Thanks