Introduction
Welcome to the documentation for the Scrypto framework. Scrypto is a powerful library that provides various cryptographic tools and algorithms to secure your data and communications. This documentation will guide you through the installation process, provide an overview of the available features, and help you get started with using Scrypto in your projects.
Installation
Requirements
- PHP 7.1 or higher
- Composer
Installation Steps
- Open your project’s terminal
- Navigate to your project’s directory
- Run the following command to install Scrypto:
composer require scrypto/scrypto
Getting Started
After successfully installing Scrypto, you can now start using it in your project. Here’s a quick guide to help you get started:
1. Import Scrypto
In your PHP file, import the necessary classes and functions from Scrypto:
use Scrypto\Hash;
use Scrypto\Cipher;
use Scrypto\KeyGenerator;
2. Hashing Data
Scrypto provides secure and efficient hashing algorithms. To hash your data, simply call the desired hashing function, passing the data as an argument:
$hashedData = Hash::bcryptHash($dataToHash);
3. Encrypting and Decrypting Data
Cipher class in Scrypto allows you to encrypt and decrypt sensitive data. Here’s how to use it:
// Generate a random encryption key
$encryptionKey = KeyGenerator::generateKey();
// Encrypt the data
$encryptedData = Cipher::encrypt($dataToEncrypt, $encryptionKey);
// Decrypt the data
$decryptedData = Cipher::decrypt($encryptedData, $encryptionKey);
Available Features
Scrypto offers a wide range of cryptographic features to keep your data secure. Some of the key features include:
Hashing Algorithms
- bcryptHash
- sha256Hash
Symmetric Encryption Algorithms
- AES256-CBC
- DES-EDE3-CBC
Key Generation
- generateKey
Conclusion
Congratulations! You now have a basic understanding of how to use Scrypto in your projects. This documentation serves as a comprehensive guide to Scrypto’s features and functionalities. Feel free to explore and experiment further with the provided functions to meet your specific cryptographic requirements.