drand / tlock-js Goto Github PK
View Code? Open in Web Editor NEWTimelock Encryption made practical. A Typescript library for encrypting for the future.
License: Other
Timelock Encryption made practical. A Typescript library for encrypting for the future.
License: Other
In my use case, the encryptor do not want the decryptor to know when decryption is possible. This is because in my use case, the timing needs to remains secret.
To avoid the decryptor to check the decryption at every epoch, one idea is that encryptor will provide the decryptor the minutes (and seconds) to check but will not tell the day/hour.
See conversation slack :
wighawag:
hey got a question on tlock. Is the decryption time public ?
if it is public by default, is there a way to ensure that only the one encrypting know when decryption will be possible ? (edited)
Will Scott
you could not include the decryption time with the encrypted blob, but it would be up to recipients to trial-decrypt every epoch
wighawag
Nice, is the tlock-js library supporting that option easily ?
The idea is that for my use case, decryptor will be able to try every hour
Will Scott
would you know that you are only encrypting at an hour granularity, or could encryption still be at any epoch?
Patrick McClurg (Protocol Labs)
right now tlock-js doesn’t enable this super easily - during encryption, the roundNumber is encoded into the AGE args and then used for retrieving the beacon during decryption time.It wouldn’t be super hard to make a fork though - you could e.g. put a round number of -1 and remove the bounds check, and change decryption to check every hour when the round number is negative
ofc it will not be compatible with the other tlock libs, but it sounds like that’s not a big deal for your use case!
wighawag:
@Will Scott, yes, basically, one idea is that the encryptor will be telling the minute (and seconds) the decryption will be ready but not the hour
@Patrick McClurg (Protocol Labs) I ll create an issue in tlock-js as I think it is a valid use case for it
Will Scott
makes sense. having a coarser quantization seems useful in not making decryptors do way too much work
If tlock-js could left out the decrypting time, application could provide their own mechanism
Currently when using tlock-js in browser, it fails at runtime with
ReferenceError: Buffer is not defined
It would be great to use something that work for both browser and node env
All the js files are hidden inside a magical dist folder again
As we changed the h3
func, the impls are no longer compatible (well... they will be after #26 gets merged).
We need to create new test vectors and add them to the relevant test (
)I'm currently trying to use tlock-js for a small project I'm working on, but I'm unable to get the module installed correctly (getting a module not found: can't resolve tlock-js error). Are there any additional parameters I should be aware of beyond those listed on the npmjs page in order to use tlock-js?
Is there an easy way to get the round that a ciphertext is encrypted until using just the ciphertext?
Ex: I send the AGE ciphertext to someone without telling them when the ciphertext is decryptable, but I want them to be able to trivially recover it
I think there may be some issues running this in pure node due to its use of fetch
. There's text in the readme to that effect, but it would be good to actually test it and remedy any issues that arise.
Hi,
Reading the doc it says about timeForRound:
timeForRound
Given a NetworkInfo object, it calculates the approximate time the given round will be emitted at (approximate because the network must work together to create the randomness).
It would be great if it gave also worst case scenario in both direction or even better a probability distribution on a range of time, so applications can predict accordingly.
I also could not find what to expect on the mainnet, Is it a one minute kind of difference we can expect or a lot more ?
Thanks
tlock-js is incompatible with vite and I suspect the error message from vite is correct and tlock-js must not follow modern export convention
Repro : https://github.com/wighawag/vite-tlock-js
pnpm i
pnpm dev
then navigate to the page and see error in console
Failed to resolve entry for package "tlock-js". The package may have incorrect main/module/exports specified in its package.json.
18:11:22 [vite] Internal server error: Failed to resolve entry for package "tlock-js". The package may have incorrect main/module/exports specified in its package.json.
Plugin: vite:import-analysis
File: /home/wighawag/dev/github.com/bug-reproduction/vite-tlock-js/src/tlock.ts
at packageEntryFailure (file:///home/wighawag/dev/github.com/bug-reproduction/vite-tlock-js/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:23382:11)
at resolvePackageEntry (file:///home/wighawag/dev/github.com/bug-reproduction/vite-tlock-js/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:23379:5)
at tryNodeResolve (file:///home/wighawag/dev/github.com/bug-reproduction/vite-tlock-js/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:23113:20)
at Context.resolveId (file:///home/wighawag/dev/github.com/bug-reproduction/vite-tlock-js/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:22874:28)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.resolveId (file:///home/wighawag/dev/github.com/bug-reproduction/vite-tlock-js/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:42847:32)
at async TransformContext.resolve (file:///home/wighawag/dev/github.com/bug-reproduction/vite-tlock-js/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:42575:23)
at async normalizeUrl (file:///home/wighawag/dev/github.com/bug-reproduction/vite-tlock-js/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:40500:34)
at async file:///home/wighawag/dev/github.com/bug-reproduction/vite-tlock-js/node_modules/.pnpm/[email protected]/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:40651:47
at async Promise.all (index 0)
Add a tlock user agent to the HTTP requests so that we can gain some insight into who is using drand for timelock
Newbie to drand here and possibly a dumb question.
Could I please check if it's possible to do it the other way around? I need the cipher text to be able to decrypted anytime until it reaches the specified expiry time
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.