CryptGuard Programming Library
Introduction
CryptGuard is a comprehensive cryptographic library, offering robust encryption and decryption capabilities. It integrates traditional cryptography with post-quantum algorithms, ensuring resilience against quantum computing threats. Designed for developers, CryptGuard empowers applications to withstand future digital security challenges. Embrace CryptGuard as your trusted ally in safeguarding privacy in the digital realm.
Syntax Overhaul and Version Information
Upcoming Changes
Our library is undergoing a syntax overhaul to enhance detail and clarity, addressing feedback for a more intuitive user experience. The current syntax focuses on providing a comprehensive understanding of the cryptographic processes, albeit with a higher complexity level.
Current Release
The present version, 1.1.0, emphasizes detailed cryptographic operations, catering to users who require a deep dive into cryptographic functionalities. This version is ideal for those who prefer an elaborate approach to cryptography and don't want to use async code, async capabilites will on a later updated reimplemented (but this time as a feature). For those who prefer an rather easy syntax should just use version 1.0.3 until the next updates are released.
Future Release
A forthcoming update will introduce a more streamlined and user-friendly interface. This version aims to simplify cryptographic operations, making the library more accessible to a broader audience. Stay tuned for its release!
Important Considerations
Data Handling in CryptographicInformation
Users should note that providing an existing file path to FileMetadata for encryption/decryption operations will overwrite the data field within CryptographicInformation with the file's content. This ensures the use of current data but replaces any existing data in the field. Caution is advised to prevent data loss.
Transition to the New Version
For those considering the transition to the updated version upon its release, familiarizing yourself with the current documentation and examples is recommended. This preparation will facilitate a smoother adaptation to the new syntax and features.
Usage Examples
Generating and Saving a Key Pair
This example illustrates generating a key pair and saving it to files, leveraging the KeyPair::new() method for key pair generation and FileMetadata::save() for persisting keys.
use crate;
use crateFileTypes;
let key_pair = new;
// Public key saving
let public_key_file_metadata = from;
public_key_file_metadata.save.expect;
// Secret key saving
let secret_key_file_metadata = from;
secret_key_file_metadata.save.expect;
Encrypting a Message using AES
let keyp = new;
let file1 = from;
let file2 = from;
let mut pubk = keyp.public_key.unwrap;
let mut seck = keyp.secret_key.unwrap;
let _ = file1.save;
let _ = file2.save;
let crypt_metadata1 = from;
let crypt_info1 = from;
let mut aes1 = new;
let pubkey = new;
let seckey = new;
let = aes1.encrypt.unwrap;
Decrypting a File with XChaCha20
let ciphertext = from;
let cipher_vec = ciphertext.load.unwrap;
let cipher = new;
let secret_key = from;
let seckey_vec = secret_key.load.unwrap;
let seckey = new;
let crypt_metadata2 = from;
let crypt_info2 = from;
let nonce_vec = ... // Use the nonce used for encryption
let mut ChaCha1 = new;
let decrypted = ChaCha1.decrypt.unwrap;
Signing and Verifying with Falcon
use crate;
// Generate a keypair using Falcon
let falcon_keypair = keypair;
// Sign a message
let message = "This is a secret message";
let signature = sign_msg.expect;
// Verify the signature
let verified = verify_msg.expect;
assert!;
Signing and Verifying with Dilithium
use crate;
// Generate a keypair using Dilithium
let dilithium_keypair = keypair;
// Sign a message
let message = "Another secret message";
let signature = sign_msg.expect;
// Verify the signature
let verified = verify_msg.expect;
assert!;
Conclusion and Looking Forward
We appreciate your engagement with our cryptographic library. As we strive to improve and evolve, your feedback and contributions are invaluable. The anticipated update promises to make cryptography more accessible and straightforward for everyone.
Thank you for your support and for making security a priority in your projects.
License
CryptGuard is licensed under the MIT LICENSE. The full license text is available in the LICENSE file in the repository.