Cipherpack v1.2.0-dirty
A Cryprographic Stream Processor
|
Classes | |
class | HashUtil |
Hash utility functions to produce a hash file compatible to sha256sum as well as to produce the hash value itself for validation. More... | |
Static Public Member Functions | |
static PackHeader | checkSignThenDecrypt (final List< String > sign_pub_keys, final String dec_sec_key_fname, final ByteBuffer passphrase, final ByteInStream source, final CipherpackListener listener, final String plaintext_hash_algo, final String destination_fname) |
Verify signature then decrypt the source passing to the CipherpackListener if opt-in and also optionally store into destination file. More... | |
static final String | default_hash_algo () |
Name of default hash algo for the plaintext message, e.g. More... | |
static PackHeader | encryptThenSign (final CryptoConfig crypto_cfg, final List< String > enc_pub_keys, final String sign_sec_key_fname, final ByteBuffer passphrase, final ByteInStream source, final String target_path, final String subject, final String plaintext_version, final String plaintext_version_parent, final CipherpackListener listener, final String plaintext_hash_algo, final String destination_fname) |
Encrypt then sign the source producing a cipherpack stream passed to the CipherpackListener if opt-in and also optionally store into destination_fname. More... | |
Static Public Attributes | |
static final int | buffer_size = 16384 |
Intermediate copy buffer size of 16384 bytes , usually the 4 x 4096 bytes page-size. More... | |
Cipherpack, a secure stream processor utilizing public-key signatures to authenticate the sender and public-key encryption of a symmetric-key for multiple receiver ensuring their privacy and high-performance message encryption.
Cipherpack securely streams messages through any media, via file using ByteInStream_File and via all libcurl network protocols using ByteInStream_URL are build-in and supported.
Note: libcurl must be enabled via -DUSE_LIBCURL=ON
at build.
A user may use the media agnostic ByteInStream_Feed to produce the input stream by injecting data off-thread and a CipherpackListener to receive the processed output stream.
Cipherpack is implemented using C++17 and accessible via C++ and Java.
READY TO USE
The following public-key signature and encryption, as well as symmetric-key message encryption operations are performed:
PackHeader
details.ChaCha20Poly1305
.Implementation performs all operation in-place
without redundant copies, processing the stream.
The stream's header contains the sender's public-key fingerprint and its signature for authentication by the receiving parties.
Further, the stream contains triples per receiver, its public-key fingerprint, the encrypted symmetric-key and the encrypted symmetric-nonce for each receiver, allowing a secure messaging between multiple parties:
Implementation uses an Authenticated Encryption with Additional Data (AEAD) encryption+MAC cipher algo, i.e. cipherpack::constants::aead_cipher_algo
.
The random nonce, unique for one message and used for the symmetric encryption is not a secret and doesn't have to be confidential. However, since we already encrypt the symmetric-key for each receiver, we transmit the nonce with it, encrypted.
The cipherpack stream will be produced as follows:
Definition at line 126 of file Cipherpack.java.
|
static |
Name of default hash algo for the plaintext message, e.g.
for encryptThenSign()
and checkSignThenDecrypt()
.
Value is BLAKE2b(512)
.
Note:
Definition at line 150 of file Cipherpack.java.
|
static |
Encrypt then sign the source producing a cipherpack stream passed to the CipherpackListener if opt-in and also optionally store into destination_fname.
crypto_cfg | Used CryptoConfig, consider using CryptoConfig::getDefault() |
enc_pub_keys | Public keys of the receiver, used to encrypt the symmetric-key for multiple parties. |
sign_sec_key_fname | Private key of the sender, used to sign the DER-Header-1 incl encrypted symmetric-key for authenticity. |
passphrase | Passphrase for sign_sec_key_fname , may be null or empty for no passphrase. |
source | The source ByteInStream of the plaintext message. |
target_path | Optional target path for the message, user application specific. |
subject | Optional subject of message from sender, user application specific. |
plaintext_version | Version of this plaintext message, user application specific. |
plaintext_version_parent | Version of this plaintext message's preceding message, user application specific. |
listener | CipherpackListener listener used for notifications and optionally to send the ciphertext destination bytes via CipherpackListener::contentProcessed() |
plaintext_hash_algo | Optional hash algorithm for the plaintext message, produced for convenience and not wired. See Cipherpack#default_hash_algo() . Pass an empty string to disable. |
destination_fname | Optional filename of the plaintext destination file, not used if null or empty (default). If not empty and file already exists, file will be overwritten. |
Definition at line 179 of file Cipherpack.java.
|
static |
Verify signature then decrypt the source passing to the CipherpackListener if opt-in and also optionally store into destination file.
sign_pub_keys | Authorized sender public-keys to verify the sender's signature and hence the authenticity of the message incl. encrypted symmetric-key and ciphertext message. |
dec_sec_key_fname | Private key of the receiver, used to decrypt the symmetric-key. It shall match one of the keys used to encrypt. |
passphrase | The passphrase for dec_sec_key_fname , may be null or empty for no passphrase. |
source | The source ByteInStream of the cipherpack containing the encrypted message. |
listener | The CipherpackListener listener used for notifications and optionally to send the plaintext destination bytes via CipherpackListener::contentProcessed() |
plaintext_hash_algo | Optional hash algorithm for the plaintext message, produced for convenience and not wired. See Cipherpack#default_hash_algo() . Pass an empty string to disable. |
destination_fname | Optional filename of the plaintext destination file, not used if empty (default). If not empty and file already exists, file will be overwritten. |
Definition at line 237 of file Cipherpack.java.
|
static |
Intermediate copy buffer size of 16384 bytes
, usually the 4 x 4096 bytes page-size.
Definition at line 129 of file Cipherpack.java.