Skip to content

schollz/wasmcrypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instructions

Compile

$ GOOS=js GOARCH=wasm go build -o main.wasm
$ cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" .

Serve

I like browsersync.

$ go get github.com/schollz/browsersync
$ browsersync

Open up localhost:8003 and in the console, you can try things like:

Generating a PAKE session key

bob = pakeInit("pass1","0");
jane = pakeInit("pass1","1");
jane = pakeUpdate(jane,pakePublic(bob));
bob = pakeUpdate(bob,pakePublic(jane));
jane = pakeUpdate(jane,pakePublic(bob));
console.log(pakeSessionKey(bob))
console.log(pakeSessionKey(jane))

Encrypt/Decrypt

> enc = encrypt("hello, world","password","salt");
> console.log(decrypt(enc,"password","salt"))
hello, world

About

PAKE in the browser, using Go wasm

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published