Questions tagged [sjcl]

The Stanford Javascript Crypto Library is a project by the Stanford Computer Security Lab to build a secure, powerful, fast, small, easy-to-use, cross-browser library for cryptography in Javascript.

The Stanford Javascript Crypto Library is a project by the Stanford Computer Security Lab to build a secure, powerful, fast, small, easy-to-use, cross-browser library for cryptography in Javascript.

Project home page

79 questions
3
votes
1 answer

JS: Decryption not possible after storing in database (SJCL)

I'm experimenting with the Stanford Javascript Crypto Library (SJCL) and want to encrypt and later decrypt a string. The following code works fine: var pw = "password"; var message = "message"; var encrypted = sjcl.encrypt(pw,…
huiozf
  • 33
  • 3
3
votes
3 answers

Secure Javascript encryption library?

I'm searching a javascript library that offers secure encryption. The client has to generate a key and all data uploaded to the server is encrypted, all data downloaded is decrypted. I need an authenticated encryption scheme, just CTR or CBC isn't…
Heinzi
  • 5,793
  • 4
  • 40
  • 69
2
votes
1 answer

How to decrypt of AES-256-GCM created with ruby in sjcl.js

I'm trying to decrypt an AES cipher generated by Ruby with the sjcl.js library. I'm getting a "corrupt" error for an unknown reason……. I want to fix the problem. For reference, when encryption and decryption were attempted in CBC mode, decryption…
YiJisol
  • 45
  • 3
2
votes
1 answer

What is the Python equivalent of this JS function to decrypt an AES-CCM-encrypted string?

I’d like to decrypt an AES-encrypted string (CCM mode) in Python 3. The following JavaScript code which is using the sjcl library is working correctly: const sjcl = require('sjcl'); const key =…
aaronk6
  • 2,701
  • 1
  • 19
  • 28
2
votes
1 answer

How to deserialize a public / private P-384 keys in Android?

I have a public/private key set created with sjcl.js in node.js using the P-384 curve. It is constructed like this: var keyPair = sjcl.ecc.elGamal.generateKeys(sjcl.ecc.curves.c384); var pubGet = keyPair.pub.get(); var secGet =…
codebird456
  • 505
  • 8
  • 19
2
votes
1 answer

How to perform sha256 hash using sjcl.hash.sha256.hash on a file content?

I am trying to perform SHA256 hash on a file content using javascript. I get the file using the following function var fileReader = new FileReader(); var fileByteArray = []; fileReader.onload = function(evt) { if (evt.target.readyState ==…
iOS-Developer84
  • 654
  • 8
  • 19
2
votes
1 answer

Is it possible to use bcrypt or scrypt as an alternative to PBKDF2 in SJCL?

I've been using the library and I really like it, but from what I have read PBKDF2 is a bit more vulnerable to brute force attacks than bcrypt or scrypt. I came across this issue about adding scrypt support, but there doesn't seem to be a clear…
Dominic P
  • 2,284
  • 2
  • 27
  • 46
2
votes
2 answers

Problems with SJCL "Cannot read property 'replace' of undefined"

Using Sjcl i try to write a little service sending and receiving encrypted data from my javascript application. Sadly, the sjcl documentation is lacking information on how to process their AES encrypted data. Their encrypt method returns an object…
Andresch Serj
  • 35,217
  • 15
  • 59
  • 101
2
votes
3 answers

Decrypting SJCL encrypted strings in Android

I've got a string that's been encrypted by SJCL server-side, and needs to be decrypted in Android using whatever libraries are available. I tried BouncyCastle, until I ran into the problem of not being able to generate a key from PBKDF2. Now I'm…
mlimb
  • 61
  • 5
2
votes
2 answers

Use JavaScript Library in Android Application

I want to use the SJCL library in an Android app that I'm building. The thing is SJCL is a javascript crypto library. I'm new to Android development and I was wondering how I could go about using the library in my project. What I'm looking to do is…
fadelakin
  • 3,763
  • 4
  • 19
  • 20
2
votes
0 answers

Does SJCL content need to be json_encode(d) when it is read from a database?

Overview I am attempting to encrypt data, send it to a database, then decrypt the data using the Stanford Javascript Crypto Library (SJCL). Problem Whenever I attempt to call the data from the database, I get a "CORRUPT: ccm: tag doesn't match"…
Pizzaface
  • 43
  • 8
2
votes
2 answers

Issue invoking Stanford javascript library encryption function from javascript engine library in JAVA6

I am trying to invoke stanford javascript library encrytion function from javascript engine library in JAVA6. With the below code using javascript engine library in JAVA6 i am getting following error: javax.script.ScriptException:…
bhargav reddy
  • 112
  • 1
  • 2
  • 8
1
vote
2 answers

Does sjcl support arraybuffers?

I'm trying to use sjcl to encrypt and then decrypt an arraybuffer. I can see in the source that sjcl has a codec for arraybuffer but I just can't figure out how to use it: const buffer = new ArrayBuffer(64); const view = new…
dicroce
  • 45,396
  • 28
  • 101
  • 140
1
vote
1 answer

Migrating the pure Nativescript 5.x project to Nativescript 6 - JS ERROR NOT READY: generator isn't seeded

Migrating the pure Nativescript 5.x project to Nativescript 6 Using nativescript-nodeify (0.8.0) , sjcl (1.0.8) and uuid (3.3.3) When executed on ios or android, sjcl.random.randomWords(PBKDF2_SALT_SIZE) is throwing the error - JS ERROR NOT READY:…
1
vote
0 answers

Signing using ElGamal or Encrypting using private key

I'm using SJCL js library: How do I use the elGamal algorithm to prove that a user posses the private key based on the public key? I also utilize the ECCDH part so I can't just use ECDSA. I want everybody to be able to verify that the user, who…
albertdiones
  • 735
  • 5
  • 10