The Encryption component is used to encrypt and decrypt strings.

The easiest way to use the Encryption component is to make sure your Controllers extend Tomahawk\Routing\Controller. You then have access to it through $this->crypt.

Otherwise just add the following parameter to the construct method of your Controller Tomahawk\Encryption\CryptInterface and it will get injected in through the Service Container.

Encrypting a String

Decrypting a String