scryptenc 0.9.3

An implementation of the scrypt encrypted data format
Documentation

scryptenc-rs

CI Version Docs License

scryptenc-rs (scryptenc) is an implementation of the scrypt encrypted data format.

The format is defined here.

Usage

Add this to your Cargo.toml:

[dependencies]
scryptenc = "0.9.3"

Example

use scryptenc::{scrypt::Params, Decryptor, Encryptor};

let data = b"Hello, world!\n";
let passphrase = "passphrase";

// Encrypt `data` using `passphrase`.
let params = Params::new(10, 8, 1, Params::RECOMMENDED_LEN).unwrap();
let ciphertext = Encryptor::with_params(data, passphrase, params).encrypt_to_vec();
assert_ne!(ciphertext, data);

// And decrypt it back.
let plaintext = Decryptor::new(&ciphertext, passphrase)
    .and_then(|c| c.decrypt_to_vec())
    .unwrap();
assert_eq!(plaintext, data);

Crate features

alloc

Enables features that require an allocator. This is enabled by default (implied by std).

std

Enables features that depend on the standard library. This is enabled by default.

serde

Enables serialization support for Params.

no_std support

This supports no_std mode. Disables the default feature to enable this.

Documentation

See the documentation for more details.

Minimum supported Rust version

The minimum supported Rust version (MSRV) of this library is v1.74.0.

Changelog

Please see CHANGELOG.adoc.

Contributing

Please see CONTRIBUTING.adoc.

License

Copyright © 2022–2024 Shun Sakai (see AUTHORS.adoc)

This library is distributed under the terms of either the Apache License 2.0 or the MIT License.

This project is compliant with version 3.0 of the REUSE Specification. See copyright notices of individual files for more details on copyright and licensing information.