X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=framework%2Fmain%2Finterfaces%2Fstreams%2Fcrypto%2Fclass_EncryptableStream.php;h=68b85c2a97ede0c252b2cece8326e50e587f2cbe;hb=ef7a7e55c59c9e887e6bb09c8c02b8126309f716;hp=c8849660298c904798c05daac6b7c0fa74bdb4c1;hpb=78a010fef84895720e796842208f01dfb619c332;p=core.git diff --git a/framework/main/interfaces/streams/crypto/class_EncryptableStream.php b/framework/main/interfaces/streams/crypto/class_EncryptableStream.php index c8849660..68b85c2a 100644 --- a/framework/main/interfaces/streams/crypto/class_EncryptableStream.php +++ b/framework/main/interfaces/streams/crypto/class_EncryptableStream.php @@ -1,13 +1,16 @@ * @version 0.0.0 - * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team + * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team * @license GNU GPL 3.0 or any newer version * @link http://www.shipsimu.org * @@ -25,6 +28,11 @@ namespace CoreFramework\Stream\Crypto; * along with this program. If not, see . */ interface EncryptableStream extends Stream { + /** + * Separator on many places + */ + const DATA_PAYLOAD_SEPARATOR = '|'; + /** * Encrypt the string with fixed salt * @@ -32,14 +40,15 @@ interface EncryptableStream extends Stream { * @param $key Optional key, if none provided, a random key will be generated * @return $encrypted Encrypted string */ - function encryptStream ($str, $key = NULL); + function encryptStream (string $str, string $key = NULL); /** * Decrypt the string with fixed salt * * @param $encrypted Encrypted string + * @param $key Optional key, if none provided, a random key will be generated * @return $str The unencrypted string */ - function decryptStream ($encrypted); + function decryptStream (string $encrypted, string $key = NULL); }