Comments (7)
Hello, i was doing some fiddling with the package and was initially just trying to make it work with the SubtleCrypto @47ng/cloak and I replaced encryptStringSync, decryptStringSync, makeKeychainSync, parseKeySync with encryptString, decryptString, makeKeychain, parseKey respectively that uses the SubleCrypto.
But my traceback shows that the /src/encryption.ts is still making a reference to some object in @47ng/cloak/dist/message.js where Node.js crypto module has been used. Am I missing something? A little direction would be helpful.
from prisma-field-encryption.
This sounds like a good idea, the main hurdle that I see for it currently is that the Node.js cryptography API is synchronous, while SubtleCrypto is async, so the visitor system would have to be converted first to async.
The underyling library used for encryption, @47ng/cloak
also has support for SubtleCrypto, so it may not be necessary to go for providers in this case.
from prisma-field-encryption.
Alright, sounds good! If cloak has support for SubtleCrypto this should be simple, right?
from prisma-field-encryption.
The asyncification of the visitor pattern might require some work to be done in a performant way (possibly running it in parallel, with a careful balance between memory usage due to the Promises overhead and total execution time per query), but it's a necessary step for making it more flexible in the future.
Would you like to try your hand at a PR?
from prisma-field-encryption.
Apologies for the delay. Unfortunately I am very busy this time of year with finals in school, and work. Thank you for the offer but I won't be able to work on a PR right now, sorry.
from prisma-field-encryption.
That is odd.. Perhaps @franky47 knows why?
from prisma-field-encryption.
@47ng/cloak
is not particularly well adapted to those newer edge runtimes with SubtleCrypto support, it would need some polish to support this use-case first before an update can be used here.
Namely, feature-detecting SubtleCrypto support based not on the presence/absence of window
. This would however only solve half of the problem, the other half being that the processing code to encrypt/decrypt data is synchronous and would need to support async operations (see my previous comments).
from prisma-field-encryption.
Related Issues (20)
- [question]: would it technically be possible to do per user encryption using `prisma-field-encryption`? HOT 2
- Disable warning: could not find a field to use to iterate over rows in model ___ HOT 2
- Plaintext values with mode=strict do not throw errors HOT 1
- Filtering secured field with mode-insensitive HOT 1
- Feature request: Add support to sanitize hashes
- Heads up about prisma 5.16.0 and "Error: no encryption key provided." HOT 1
- `Argument of type '() => Promise<void>' is not assignable to parameter of type 'PrismaPromise<any>[]'.` when using `prisma.$transaction` after extending client HOT 4
- Filtering with 'where: { fieldName: { in: ['value1', 'value2'] } } Not Supported
- Do we need both `CLOAK_KEYCHAIN` and `CLOAK_MASTER_KEY` or one of them HOT 1
- [KMS]: Is it working with cryptographic keys on GCP KMS? HOT 5
- NestJS PrismaService and Extending it With Encryption HOT 8
- [mongo]: Hashes are not computed HOT 5
- Doesn't work with the Prisma fluent API HOT 5
- Feature request: HMAC Support for Hashing HOT 5
- Fields that are selected through include are returned as cyphertext HOT 6
- Filter with "contains" HOT 1
- "not" filter not works in hash fields HOT 2
- Breaks with 5.9.1 release of Prisma HOT 5
- Erroneous `rotation migrations are disabled` warning HOT 2
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 prisma-field-encryption.