-
Notifications
You must be signed in to change notification settings - Fork 9
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
Using in the browser #5
Comments
It's feasible, but you're probably better off using the AWS JavaScript Encryption SDK. At the very least, you're going to want to use KMS to manage your keys. |
The purpose behind using ciphersweet for this was for searchable encryption. I'm not sure AWS encryption can help with that. |
The purpose behind CipherSweet is also symmetric-key encryption, and you'd be giving out your encryption key via JavaScript to anyone who accessed the page. You can use CipherSweet only for the indexing purposes, and then use something else (e.g. the AWS Encryption SDK, backed by KMS) for record encryption. Or you could use something like SodiumPlus for |
Thank you for the insight. The purpose is to not have access to the Customer data at all from the service provider side. From what I understand encrypting via KMS does not ensure that. The owner of the AWS account can still decrypt data. That is what we're trying to avoid. Regarding giving out the encryption key, yes. I am aware of that. But the Encrypted data would still be secured by regular permissions on the user account, only an authorized account (by checking a JWT, for example) could retrieve the encrypted blob and then decrypt it locally. So it would be an additional layer over a classic permission/ACL layer. Does this still sound terribly wrong? :) |
Hi @paragonie-security! I have been trying to use this in the browser and failed so far, due to dependencies that couldn't be resolved. I tried a very simple example and got errors regarding the dependency Does this actually work in the browser? And if so, is there and example implemantion somewhere you could point me to? Any help would be really appreciated! Best, Example Codeimport {
BlindIndex,
CipherSweet,
EncryptedField,
FIPSCrypto,
StringProvider,
} from "ciphersweet-js";
export async function foo() {
const cipherSweet = new CipherSweet(
new StringProvider(
"4e1c44f87b4cdf21808762970b356891db180a9dd9850e7baf2a79ff3ab8a2fc"
),
new FIPSCrypto()
);
let ssn = new EncryptedField(cipherSweet, "contacts", "rezeptTyp")
// Add a blind index for the "last 4 of SSN":
.addBlindIndex(
new BlindIndex(
// Name (used in key splitting):
"rezeptTyp",
// List of Transforms:
[],
// Bloom filter size (bits)
16
)
);
// Some example parameters:
let contactInfo = {
name: "John Smith",
ssn: "123-45-6789",
email: "foo@example.com",
};
const result = await ssn.prepareForStorage(contactInfo["ssn"]);
return result;
} Error Messages |
I'm interested in a browser-based install, as well. I think most of the reqs are available in browser, such as browserFS and buffer but ofc these need to be thoughtfully included for security concerns. |
@paragonie-security coming here with similar concern. Does what @andreialecu says seem terrible? Btw, @andreialecu I wonder, did you end up with the way you suggested? |
I'm thinking of using this in the browser, as I've read in the documentation that it should be supported.
Basically I need to store some sensitive user data, but don't want the hassle of having to deal with the security side of it. It would be better just not having access or storing the unencrypted data at all in our backend/databases.
So I'm thinking of letting the user enter a key into the web app, then use client side javascript to deal with decryption of data. The key would be stored probably in localStorage, and on every new browser they connect from, they'd need to re-enter the key in order to be able to decrypt or update the sensitive data.
Does this sound feasible to implement using ciphersweet?
The text was updated successfully, but these errors were encountered: