![]() |
PIP 5.5.3
Platform-Independent Primitives
|
Class for encrypting and decrypting data. More...
#include <picrypt.h>
Public Member Functions | |
| PICrypt () | |
| Constructor that generates a random key. | |
| bool | setKey (const PIByteArray &key) |
| Set key to "key", key size must be a sizeKey() | |
| bool | setKey (const PIString &secret) |
| Generate and set key from keyphrase "secret". | |
| PIByteArray | key () |
| Returns current key. | |
| PIByteArray | crypt (const PIByteArray &data) |
| Encrypt given data "data", result size will be increased by sizeCrypt() | |
| PIByteArray | decrypt (const PIByteArray &crypt_data, bool *ok=0) |
| Decrypt given data "crypt_data". | |
| PIByteArray | signMessage (const PIByteArray &data, const PIByteArray &secret_key) |
| Calculate digital signature for data. | |
| bool | verifySign (const PIByteArray &data, const PIByteArray &signature, const PIByteArray &public_key) |
| Verify digital signature of signed message. | |
| PIByteArray | crypt (const PIByteArray &data, const PIByteArray &public_key, const PIByteArray &secret_key) |
| Encrypt given data "data". | |
| PIByteArray | decrypt (const PIByteArray &crypt_data, const PIByteArray &public_key, const PIByteArray &secret_key, bool *ok=0) |
| Decrypt given data "crypt_data". | |
Static Public Member Functions | |
| static PIByteArray | crypt (const PIByteArray &data, PIByteArray key) |
| Encrypt given data "data" with key "key", result size will be increased by sizeCrypt() | |
| static PIByteArray | decrypt (const PIByteArray &crypt_data, PIByteArray key, bool *ok=0) |
| Decrypt given data "crypt_data" with key "key". | |
| static PIByteArray | hash (PIString secret) |
| Generate hash from keyphrase "secret", may be used as a key for encryption. | |
| static PIByteArray | hash (const PIByteArray &data) |
| Generate hash from bytearray. | |
| static PIByteArray | hash (const PIByteArray &data, const unsigned char *key, size_t keylen) |
| Generate hash from bytearray. | |
| static size_t | sizeHash () |
| Returns hash size. | |
| static ullong | shorthash (const PIString &s, PIByteArray key=PIByteArray()) |
| Generate short hash from string "s", may be used for hash table. | |
| static PIByteArray | generateKey () |
| Generate random key. | |
| static PIByteArray | generateRandomBuff (int size) |
| Generate random buffer. | |
| static size_t | sizeKey () |
| Returns key size. | |
| static size_t | sizeCrypt () |
| Returns size which be added to data size in encryption process. | |
| static bool | generateSignKeys (PIByteArray &public_key, PIByteArray &secret_key) |
| Function randomly generates a secret key and a corresponding public key for digital signature. | |
| static bool | generateSignKeys (PIByteArray &public_key, PIByteArray &secret_key, const PIByteArray &seed) |
| Function generates a secret key from input data and a corresponding public key for digital signature. | |
| static PIByteArray | extractSignPublicKey (const PIByteArray &secret_key) |
| Function extract sign public key from sing secret key. | |
| static bool | generateKeypair (PIByteArray &public_key, PIByteArray &secret_key) |
| Function randomly generates a secret key and a corresponding public key for authenticated encryption. | |
| static bool | generateKeypair (PIByteArray &public_key, PIByteArray &secret_key, const PIByteArray &seed) |
| Function generates a secret key from input data and a corresponding public key for authenticated encryption. | |
| static PIByteArray | passwordHash (PIString password, const PIByteArray &seed) |
| Generate password hash from "password". | |
| static PIString | version () |
| Returns libsodium version. | |
Class for encrypting and decrypting data.