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
26
votes
2 answers

Good Stanford Javascript Crypto Library (SJCL) examples? (JS cryptography)

I am looking at a way to do client-side cryptography in Javascript (keeping http://www.matasano.com/articles/javascript-cryptography/ in mind) and have found SJCL. But I seem unable to find good code examples for it. Any pointers?
Felix Rabe
  • 4,206
  • 4
  • 25
  • 34
9
votes
3 answers

How do I implement public/private key cryptography in SJCL?

I have used Stanford Javascript Crypto Library (SJCL) for symmetric AES encryption (based on the examples on their demo page). However I have an additional requirement to generate a key pair, encrypt data with a public key, and decrypt data with a…
waifnstray
  • 547
  • 5
  • 6
9
votes
1 answer

SJCL AES-128-CCM decryption in Ruby

I am trying to implement the SJCL decryption of aes-128-ccm encrypted strings in Ruby. After reading a similar question I see that this should be supported in newer versions of the OpenSSL library, and so i have installed the development version…
dtr
  • 91
  • 3
9
votes
1 answer

Getting hex representation of sha256 hash using SJCL

The SJCL docs provide the following code as an example for sha256: var bitArray = sjcl.hash.sha256.hash("message"); var digest_sha256 = sjcl.codec.hex.fromBits(bitArray); The digest in that example being equal to a 64-character hex string, when…
Andrey Fedorov
  • 9,148
  • 20
  • 67
  • 99
8
votes
1 answer

Unexpected result decrypting using PHP AES CCM mode

I am attempting to reproduce an encryption operation using AES-256-CCM that is currently performed in Java with the Bouncy Castle provider. When attempting the same operation in PHP using openssl I cannot find a set of parameters that produces the…
Josh Glick
  • 83
  • 3
7
votes
1 answer

Benchmarking WebCrypto is much slower than third-party libraries?

I am evaluating how WebCrypto performance compares to third-party crypto libraries SJCL and Forge. I would expect WebCrypto to be much faster since it is a native browser implementation. This has also been benchmarked before and has shown such. I…
kspearrin
  • 10,238
  • 9
  • 53
  • 82
7
votes
3 answers

Google Spreadsheet: Encrypt cell content with Google Apps Script

I have a Google Spreadsheet and would like to encrypt the content of a few cells (I do not care which encryption method is being used as long as there is an equivalent decryption method for iOS). Unfortunately there are no built-in encryption…
AlexR
  • 5,514
  • 9
  • 75
  • 130
7
votes
1 answer

Elliptic curve cryptography with SJCL in JS and OpenSSL in Ruby

I am working on a web application which must be able to encrypt data with ECC on the server side and decrypt it in the browser. The only library I have found that is capable of this in JS is SJCL. However, since ECC support in SJCL seems a bit…
gsx1022
  • 73
  • 1
  • 4
6
votes
3 answers

Decryption of AES created with sjcl.js in ruby

Hi so lets assume that client-side has a key that is not transfered via the same channel as the encrypted data. What I am trying to accomplish is to decrypt the result of Stanford Javascript Crypto Library (sjcl) in ruby. or for a generalisation in…
Leon Fedotov
  • 7,421
  • 5
  • 30
  • 33
5
votes
0 answers

Why can't I catch an import error in React Native?

This code fails in React Native, but not in Node: try { return require('module-does-not-exist'); }catch (e) { return null; } Can anyone tell me why? Why I care: I am trying to use the Stanford JavaScript Crypto Library in my React Native app,…
Jordan Eldredge
  • 1,587
  • 1
  • 19
  • 25
5
votes
1 answer

Encrypting files with SJCL client-side

I have problem encrypting files with SJCL and javascript. I have managed to encrypt text-files with using FileReader API and readAsBinaryString. When it comes to encrypting pdf/png/.. then problem arrises probably due to encoding. I found that I…
Yetti
  • 327
  • 1
  • 4
  • 17
5
votes
2 answers

How to use Stanford PRNG to generate a random string?

I need to generate a secure 50 characters random string in the users browsers. Looking at sjcl.prng I've got this so far: $(document).ready(function () { sjcl.random = new sjcl.prng(8); sjcl.random.startCollectors(); …
Martijn19
  • 189
  • 4
  • 13
5
votes
2 answers

Why does SJCL report "this is not JSON" when trying to decode this JSON snippet?

I'm using SJCL, and it works fine with small ASCII strings. But when I try to decode this piece of JSON (the result of the encryption of an HTML page) I get a "this is not JSON!" error. The JSON has been produced by SJCL, and while I did encode it…
Bite code
  • 578,959
  • 113
  • 301
  • 329
4
votes
1 answer

RNCryptor IOS + Javascript encryption / decryption AES 256

I am new to encryption and i am trying to get some symmetric encryption usign AES256 going from a mobile app to a webpage through websockets. I Encrypt the data using RNCryptor default settings IOS CODE NSString* message = @"testmessage"; …
adrian.coroian
  • 582
  • 4
  • 13
4
votes
2 answers

Encrypt in Javascript with SJCL and decrypt in PHP

I want to encrypt some data in Javascript and after sending it the php server it could be decrypted. I'm planig to use JS encryption library as SJCL : http://crypto.stanford.edu/sjcl/ . Up to now I can encrypt my data in JS and send it via ajax…
Gihan De Silva
  • 458
  • 8
  • 17
1
2 3 4 5 6