You are here

public function Reverse::decrypt in AES encryption 8.2

Recover previously scrambled string.

Overrides AESPluginBase::decrypt

File

src/Plugin/AES/Reverse.php, line 48

Class

Reverse
Sample cryptor plugin. Does not really encrypt a string but just doing minor scrambling.

Namespace

Drupal\aes\Plugin\AES

Code

public function decrypt($data, $key = FALSE, $cipher = FALSE) {
  if (strpos($data, self::SIGNATURE) !== 0) {
    throw new \Exception("Sorry, this is not mine: " . $data);
  }
  return strrev(substr($data, strlen(self::SIGNATURE)));
}