docs.rs failed to build win-crypto-ng-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
win-crypto-ng-0.5.1
win-crypto-ng
Safe Rust bindings to Microsoft Windows Cryptography API : Next Generation (CNG)
CNG are cryptographic primitives and utilities provided by the operating system and/or hardware. It is available since Windows Vista and replaces the now deprecated CryptoAPI.
The primitives do not depend on OpenSSL or other libraries of the sort, they are provided by Microsoft and/or by the hardware manufacturer. They are the primitives used in kernel space programs. Therefore, if you are using Microsoft Windows, you already accepted to trust these primitives.
CNG Features
- Validated by FIPS 140-2 and part of the Target of Evaluation for the Windows Common Criteria certification
- Full support for NSA Suite B algorithms
- Kernel support (not through the Rust bindings)
- Auditing in the key storage provider (KSP)
- Thread safe
Supported features in Rust
- Symmetric encryption
- Supported algorithms: AES, DES, DES-X, RC2, 3DES, 3DES-112.
- Supported chaining modes: ECB, CBC, CFB.
- Hash functions
- Supported algorithms: SHA-1, SHA-256, SHA-384, SHA-512, SHA-512, MD2, MD4, MD5.
More to come
Examples
Symmetric encryption
use ;
const KEY: &'static str = "0123456789ABCDEF";
const IV: &'static str = "asdfqwerasdfqwer";
const DATA: &'static str = "This is a test.";
let algo = open.unwrap;
let key = algo.new_key.unwrap;
let ciphertext = key.encrypt.unwrap;
let plaintext = key.decrypt.unwrap;
assert_eq!;
Hash functions
use ;
const DATA: &'static str = "This is a test.";
let algo = open.unwrap;
let mut hash = algo.new_hash.unwrap;
hash.hash.unwrap;
let result = hash.finish.unwrap;
assert_eq!;
License
Licensed under the 3-Clause BSD License. See LICENSE.md for more details.
Copyright (c) 2019 Émile Grégoire. All rights reserved.