Custom Data Encryption

Skynet architecture is easy to extend and to customize. Even core features can be replace by custom ones. In this section you will see how to customize or extends Skynet by own core elements. By default, Skynet offers all sending and receiving data encryption by:

- openSSL
- Mcrypt
- base64

You can create and add your own encryption method by implementing:

/src/Skynet/Encryptor/SkynetEncryptorInterface.php

and adding new encryptor to:

/src/Skynet/Encryptor/SkynetEncryptorsFactory.php

 /**
  * Registers encryptor classes in registry
  */
  private function registerEncryptors()
  {
    $this->register('openSSL', new SkynetEncryptorOpenSSL());
    $this->register('mcrypt', new SkynetEncryptorMcrypt());
    $this->register('base64', new SkynetEncryptorBase64());
  }

In registration method above you can set encryption method in /src/SkynetUser/SkynetConfig.php file by changing option:

$config['core_encryptor']

Where option value is the name of encryptor defined in register method in factory.

Encryptors are placed in directory:
/src/Skynet/Encryptor/
Full API Documentation is included in Skynet packages available on GitHub.