Skip to content
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

Web examples client encryption #412

Draft
wants to merge 774 commits into
base: main
Choose a base branch
from
Draft

Conversation

nicktaras
Copy link
Contributor

No description provided.

Weiwu Zhang and others added 30 commits November 18, 2019 18:14
first sprint of UEFA tsml ticket
added redeemed text, compressed images
WIP add basic edcon draft TokenScript
correct contracts

swap
TS Template es.html front-end for 6/11 tickets WIP
nicktaras and others added 21 commits January 5, 2021 23:54
…r demo is in working order across all scenarios.
…ed a polyfill for BigInt (however my intention is to move to use the attestation lib very soon and remove this inside the example code)
…er usage and a significantly larger userbase.
…edDevonTicket.jsto work with this polyfill library.
switched npm package polyfill for bigint to big-integer, updated Sign…
@SmartLayer
Copy link

let's do an experiment if you generate an encryption key and not store it in the Local storage, encrypt a message, copy the encrypted (or store it in local storage), then close the browser and open it again, access the same key, can you decrypt the message? note that in the entire time you can't save the key in the local storage otherwise, it defeats the purpose of using encryption in the first place.

I am beginning to worry that the API maker in the web api didn't persist the key anywhere, making it impossible to use the same key across the session unless you manually save the key somewhere. If it is the case, the api isn't very helpful to us.

return window.crypto.subtle.generateKey({
name: 'AES-GCM',
length: 256,
}, true, ['encrypt', 'decrypt'])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The encryption key should not be extractable if you don't intend to export it

Copy link
Collaborator

@jot2re jot2re left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any additional comments to what @colourful-land said. However, I am also completely unfamiliar with JS and its security.
The only thing I can think of, is if there needs to be done something explicitly to ensure that the key is associated with only a specific web domain that constructed it? Or if this is handle implicitly by SubtleCrypto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet