mirror of
https://github.com/avinal/Krypto.git
synced 2026-01-10 07:08:35 +05:30
add initial documentation
Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
This commit is contained in:
@@ -5,11 +5,23 @@
|
|||||||
* @since March 06, 2021
|
* @since March 06, 2021
|
||||||
*
|
*
|
||||||
* Encryptor class implementation
|
* Encryptor class implementation
|
||||||
|
* The Encryptor class is a thin wrapper around Blowfish implmentation to encrypt
|
||||||
|
* and decrypt the file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Encryptor.h"
|
#include "Encryptor.h"
|
||||||
|
|
||||||
namespace krypto {
|
namespace krypto {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A wrapper over Blowfish::encrypt() function to encrypt files.
|
||||||
|
*
|
||||||
|
* @param input_buf Input char buffer
|
||||||
|
* @param key Password
|
||||||
|
* @param in_size Input size of the buffer
|
||||||
|
*
|
||||||
|
* @return Size of buffer after encryption
|
||||||
|
*/
|
||||||
uint64_t Encryptor::blowfish_encrypt(std::vector<char> &input_buf,
|
uint64_t Encryptor::blowfish_encrypt(std::vector<char> &input_buf,
|
||||||
std::string const &key, uint64_t in_size) {
|
std::string const &key, uint64_t in_size) {
|
||||||
uint32_t L = 0, R = 0;
|
uint32_t L = 0, R = 0;
|
||||||
@@ -36,6 +48,15 @@ uint64_t Encryptor::blowfish_encrypt(std::vector<char> &input_buf,
|
|||||||
return input_buf.size();
|
return input_buf.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A wrapper over Blowfish::decrypt() function to decrypt files.
|
||||||
|
*
|
||||||
|
* @param input_buf Input char buffer
|
||||||
|
* @param key Password
|
||||||
|
* @param in_size Input size of the buffer
|
||||||
|
*
|
||||||
|
* @return Size of buffer after decryption
|
||||||
|
*/
|
||||||
uint64_t Encryptor::blowfish_decrypt(std::vector<char> &input_buf,
|
uint64_t Encryptor::blowfish_decrypt(std::vector<char> &input_buf,
|
||||||
std::string const &key, uint64_t in_size) {
|
std::string const &key, uint64_t in_size) {
|
||||||
uint32_t L = 0, R = 0;
|
uint32_t L = 0, R = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user