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
1
vote
1 answer

how to decrypt in SJCL using 256 bit key

i am new in SJCL crypto library, i am doing the following for encrypting the plain text using 256 bit key in var h = sjcl.codec.hex ; salt = h.fromBits(sjcl.random.randomWords('10','0')); var encryptedMessage =…
Novice
  • 401
  • 7
  • 27
1
vote
2 answers

How to decrypt AES with SJCL

I want to decrypt AES by given cipher and key with the Stanford Javascript Crypto Library (SJCL), but i can't pass the key: var key = 'key'; var cipher = 'abjslö'; var aes = new sjcl.cipher.aes(key); var plaintext =…
Olli
  • 401
  • 5
  • 16
1
vote
1 answer

Cannot use sjcl in Appcellerator Titanium project

I am trying to encrypt some text with sjcl (Stanford Javascript Crypto Library) in my Titanium (target: iOS and Android) project. I am using the simplest method, with no other options: sjcl.encrypt("mypassword", "mytext"); The app just hangs on…
1
vote
3 answers

is sjcl.encrypt using AES or SHA256

I'm using the SJCL library to encrypt/decrypt messages. The question I have is that I don't know which is used AES or SHA256 Here is my code: var h = sjcl.codec.hex, count = 2048 ; salt = h.fromBits(sjcl.random.randomWords('10','0')); var key =…
Jeanluca Scaljeri
  • 26,343
  • 56
  • 205
  • 333
0
votes
0 answers

decrypt an ArrayBuffer with sjcl.decrypt which is not a json

Before I encrypted my data I've put it into this format: let a = new TextEncoder().encode(JSON.stringify(data)) After encryption, I've encoded it for storing that way: let b = new Uint8Array(a) and finally converted it into base64. Now I want to…
Neneil
  • 105
  • 12
0
votes
1 answer

CryptoKit - Encrypt with public key?

To give you the context, there is a developer who develops the API of the project and there is a part of the json that will be encrypted. So I have to decipher his content. He has listed all the functions that I will need on the iOs side. So I have…
Insou
  • 1,303
  • 1
  • 13
  • 17
0
votes
0 answers

TypeError: Cannot read property 'elGamal' of undefined

Im running the below code snippet and I'm getting the error TypeError: Cannot read property 'elGamal' of undefined var sjcl = require("sjcl"); var keys = sjcl.ecc.elGamal.publicKey(); //choose a stronger/weaker curve var pubkem =…
Medi
  • 1,026
  • 2
  • 9
  • 12
0
votes
0 answers

AES GCM 256 Encryption in Javascript

I want to implement the Javascript equivalent of Java AES GCM 256 code Java code is as follows: public class AES { private static final int GCM_IV_LENGTH = 12; private static final int GCM_TAG_LENGTH = 16; private static final String GIVEN_KEY =…
0
votes
1 answer

Can I compile SJCL library with Google closure compiler?

I have a vanilla javascript project that is compiled and minified using Closure Compiler v20181210. I want to use SJCL in that project for crypto. I copied this file into my own project and wrote code using the library. But when I try to compile…
0
votes
1 answer

Generate public key in browser if I only have the existing private key

I'm generating new Ethereum addresses using the scep256k1 curve. Due to storage and hardware limitations, I'm only able to store the private key. I'm looking for ways to generate the public key for asymmetric encryption (NOT the Ethereum public…
hci-make
  • 45
  • 1
  • 6
0
votes
0 answers

How to use elGamal encryption keys in Android?

I have the following keypair created with SJCL.js on node.js var keyPair = sjcl.ecc.elGamal.generateKeys(sjcl.ecc.curves.c384); I understand that I need somehow elGamal in Android as well. I want to implement a chat feature whereby every text chat…
codebird456
  • 505
  • 8
  • 19
0
votes
2 answers

Can't resolve 'crypto' in './node_modules/sjcl' while using SJCL in Angular 7

I want to encrypt data at clients side, so I found SJCL npm. Gone through their documentation. However, less documentation provided by SJCL contributors, can't implement that in Angular I have tried the following. I installed the package npm…
Deepak-ranolia
  • 33
  • 2
  • 10
0
votes
0 answers

java decryption compatible with sjcl throws error - mac check in CCM failed

I am trying to decrypt on java an encrypted message that I received from client that uses sjcl for encriptyon I use sjcl with default parameters here is what I have so far public static void decrypt(){ try { String…
Claudiu
  • 485
  • 1
  • 4
  • 17
0
votes
1 answer

SJCL library decryption issue

I'm having an issue when I attempt to do a simple decryption with the SJCL library. I can encrypt data fine. In this example I have saved encrypted data like so: encdata = sjcl.encrypt($('input[name="pass"]').val(),…
user3515232
  • 133
  • 2
  • 12
0
votes
1 answer

Using SJCL library in Angular2

In my app i would like to use "Stanford Javascript Crypto Library" which has a typing and i also see https://github.com/Evgenus/sjcl-typescript-definitions. I dont understand how i can use it in my project. How can i use the…
Roninio
  • 1,761
  • 1
  • 17
  • 24