encrypt() public method

Encrypts the given $string using the $key variable as encryption key.
public encrypt ( string $string, string $key ) : string
$string string Raw string that should be encrypted.
$key string Security key used for encryption.
return string Encrypted key.
Example #1
0
 public function testEncryptDecrypt()
 {
     $crypt = new Crypt('Password');
     $encrypted = $crypt->encrypt('password', 'someSecuredKey12');
     $this->assertNotSame('password', $encrypted);
     $decrypted = $crypt->decrypt($encrypted, 'someSecuredKey12');
     $this->assertSame('password', $decrypted);
 }