Crate dco3_crypto

source ·
Expand description

dco3-crypto

dco3-crypto is a wrapper around symmetric and asymmetric encryption used in DRACOON. DRACOON is a cloud service provider - more information can be found on https://dracoon.com Files are encrypted with AES 256 GCM using random bytes as individual key for each file. Users have a symmetric RSA keypair (4096bit) and use the public key to encrypt the file keys for file en- and decryption. The private key is used to decrypt file keys.

The crate is based on openssl, which allows to generate keypairs and to perform desired en- and decryption operations.

Structs

Allows chunked en- and decryption. Holds a reference to a buffer to store the mssage, processed bytes as count and the used plain file key and mode.
Implements symmetric and asymmetric encryption for DRACOON by implementing traits using the openssl crate
Represents the state of the rescue keys in a room
Represents the encrypted file key Contains key, iv and tag used for decryption key, iv, and tag are base64 encoded bytes The key is additonally encrypted with public keypair encryption
Represents the encrypted file key Contains key, iv and tag used for decryption key, iv, and tag are base64 encoded bytes key is the plain base64 encoded random bytes used
Asymmetric plain user keypair container The private key is in plain and can be used for decryption
Container holding only the private key used for file key decryption
Container holding only the public key used for file key encryption
Asymmetric user keypair container The private key is protected via secret and needs to be decrypted for usage

Enums

Represents the version of the encrypted file key Indicates which asymmetric keypair version is required Standard is 4096 bit (2048 bit for compatibility only)
Possible states of rescue keys in a room
Represents the used cipher for the plain file key used for symmetric encryption / decryption Only AES256 GCM is currently used
Represents the user keypair version Standard is 4096 bit (2048 bit for compatibility only)

Traits

Trait representing necessary functions for symmetric decryption
Trait representing all functions required for asymmetric encryption
Trait representing necessary functions for symmetric encryption
Trait to get only the public key container of either a public key or a user keypair container

Type Definitions