-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crypto Module #276
Crypto Module #276
Conversation
let f = File::open(src)?; | ||
let mut reader = BufReader::new(f); | ||
let mut buffer: Vec<u8> = Vec::new(); | ||
reader.read_to_end(&mut buffer)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to switch to a streaming encryption for better performance with large files.
I've seen a few c2s crash trying to encrypt Medium to large files especially on low powered VMs in competitions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few thoughts but other wise look good to me.
The <b>crypto.aes_encrypt_file</b> method encrypts and decrypts the given src file, encrypts it using the given key, and writes it to disk at the dst location. | ||
|
||
This uses the AES CTR algorithm, and the key parameter will be used for the key and IV. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the docs for aes_decrypt_file
Codecov Report
@@ Coverage Diff @@
## main #276 +/- ##
==========================================
+ Coverage 71.91% 74.75% +2.84%
==========================================
Files 90 94 +4
Lines 5739 6088 +349
==========================================
+ Hits 4127 4551 +424
+ Misses 1526 1451 -75
Partials 86 86
... and 14 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Found what was causing last 2 bytes to get cut. Pushing fix soon. |
LGTM 🏎️ |
* Add Grounds for Crypto * Add crypto docs * Implement crypto.aes_encrypt_file() and crypto.hash_file() * Fix Newlines * Fix Tests for AES Encrypt * Debug * Everything Works Now * Allow Support for Encrpyting File in Place * It Needed a Check for Destination File Existing * Remove Redundant File Creation * Fix Perfect Block Size Files * Docs and Tests * Windows Fix
* Add Grounds for Crypto * Add crypto docs * Implement crypto.aes_encrypt_file() and crypto.hash_file() * Fix Newlines * Fix Tests for AES Encrypt * Debug * Everything Works Now * Allow Support for Encrpyting File in Place * It Needed a Check for Destination File Existing * Remove Redundant File Creation * Fix Perfect Block Size Files * Docs and Tests * Windows Fix
* Add Grounds for Crypto * Add crypto docs * Implement crypto.aes_encrypt_file() and crypto.hash_file() * Fix Newlines * Fix Tests for AES Encrypt * Debug * Everything Works Now * Allow Support for Encrpyting File in Place * It Needed a Check for Destination File Existing * Remove Redundant File Creation * Fix Perfect Block Size Files * Docs and Tests * Windows Fix
Crypto Module (#276) * Add Grounds for Crypto * Add crypto docs * Implement crypto.aes_encrypt_file() and crypto.hash_file() * Fix Newlines * Fix Tests for AES Encrypt * Debug * Everything Works Now * Allow Support for Encrpyting File in Place * It Needed a Check for Destination File Existing * Remove Redundant File Creation * Fix Perfect Block Size Files * Docs and Tests * Windows Fix
What type of PR is this?
/kind documentation
/kind feature
/kind api-change
/kind eldritch-function
What this PR does / why we need it:
Adds the crypto module with methods to encrypt and hash files.
Starts framework for future cryptography-based methods.
Which issue(s) this PR fixes:
Fixes #67
Fixes #68
Fixes #275