Comments (3)
The performance problem you are noticing is the cost of running the scrypt PBKDF on the user passphrase, which is automatically set at encryption time to a hardness level of at least 1 second of computation on the current machine (and due to the granularity of the hardness setting could be anywhere between 1 and 2 seconds). This is a security measure used by all password-based encryption mechanisms, and thus you'll likely see the same performance issues with any other library. Additionally, when used this way, the passphrase is run through PBKDF with a unique salt for each encryption (as a defense against security issues related to passphrase reuse), which means the 1-2 seconds of PBKDF cost are paid per row.
[Obligatory "I Am Not Your Cryptographer" disclaimer]
Instead of encrypting every row with the user's passphrase, a more performant approach would be to encrypt every row with a native age key, and encrypt that with the user's passphrase. Then on start, your application could decrypt the native age key into memory, and then use that for on-the-fly encryption and decryption of rows.
from rage.
@str4d is there a way for me to use a "native age key" directly to encrypt a stream of data?
I'll maybe try to make the Stream struct public so it can be reusable for as long as my application is opened.
from rage.
Instead of encrypting every row with the user's passphrase, a more performant approach would be to encrypt every row with a native age key, and encrypt that with the user's passphrase.
I think it's currently impossible to do that right now because StreamWriter::finish()
consumes itself after it's used.
from rage.
Related Issues (20)
- Error: (stanza 0 0) Failed to decrypt YubiKey stanza HOT 1
- Implement labels
- UX: How to add a recipient to an existing age file? HOT 2
- Please don't re-tag releases HOT 5
- UX: Pronounciation HOT 3
- UX: failed to fill whole buffer with ArmoredWriter HOT 1
- Grease data included in file header
- Only one identity sent to plugin in "identity-v1" phase when multiple are provided HOT 3
- RUSTSEC-2023-0071: Marvin Attack: potential key recovery through timing sidechannels
- Release v0.9.3? HOT 1
- Invalid scrypt work factor calculation on system with bad SystemTime precision
- v0.9 Breaking Change? HOT 5
- DX: Place i18n behind a feature flag. HOT 3
- `rage-keygen` overwrites existing key files since 0.6.0
- Expose fatal errors from `rage-keygen`
- Migrate away from `gumdrop` for argument parsing HOT 3
- UX: allow to use the shell process substitution to provide the identity file when decrypting HOT 1
- Name conflict with Rage the video player HOT 5
- Securerage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rage.