sjcl

Can I compile SJCL library with Google closure compiler?

China☆狼群 提交于 2020-06-29 03:20:08
问题 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 it, Closure Compiler throws a bunch of errors from the library (pasted below). On the SJCL website, it says that the file is compressed using Google Closure Compressor. So I imagine it should be compatible with Closure? Why is it not compiling then?

How to decrypt AES with SJCL

十年热恋 提交于 2020-03-24 11:41:12
问题 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 = aes.decrypt(cipher); alert(plaintext); This dosen't work. Referred to the documentation, the key has to be "an array of 4, 6 or 8 words". How could this be done? 回答1: The key has to be an AES key, which is 128, 192 or 256 bits. The SJCL library however operates on 32 bit machine

Encrypt in Javascript with SJCL and decrypt in PHP

孤街浪徒 提交于 2020-01-12 09:18:06
问题 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 post. my JS code lool like this. sjcl.encrypt('a_key','secured_message'); My question is how do I decrypt my data in php. If it is possible show me how to do it with an example code. (note: SSL is not a option for me, and now I'm planning to use the

CryptoJS AES Increase File Size

你。 提交于 2019-12-24 13:26:32
问题 Thank you for your help. I have a problem with sjcl library or cryptojs aes library. Everytime i encrypt my file with aes the file size is * 2. For example: When i upload a 4mb file then there is a 8mb file on my server. I split the file on block which bytesize can be divided by 16. Please help me This is the way i encrypt the file: var l_EncryptetData = CryptoJS.AES.encrypt(p_ChunkData, p_FileKey).toString(); And this is a example array with block sizes from the 4mb file: 0: 1572864 1:

Using SJCL library in Angular2

房东的猫 提交于 2019-12-23 04:58:12
问题 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 command sjcl.encrypt("password", "data") in my project. i am using angular 4, angular-cli beta 2 i have run npm install --save-dev @types/sjcl tsconfig.app.json { "compilerOptions": { "outDir": "../out-tsc/app", "module": "es2015", "baseUrl": "", "types": [ "sjcl" ] },

is sjcl.encrypt using AES or SHA256

别等时光非礼了梦想. 提交于 2019-12-23 03:49:51
问题 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 = h.fromBits( sjcl.misc.pbkdf2(somePassword, h.toBits(salt), count) ) ; Next I can encrypt/decrypt like var encMessage = sjcl.encrypt(key, message) ; sjcl.decrypt(key, encMessage) ; AES or SHA256 or something else ? 回答1: pbkdf2 for key generation is

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

为君一笑 提交于 2019-12-20 09:21:36
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . 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? 回答1: I did a presentation last year titled Developer's Guide to JavaScript and Web

generate a key for SJCL that expires automatically after a period of time?

浪子不回头ぞ 提交于 2019-12-14 04:03:20
问题 I want to encrypt and decrypt the data on client-side for that i am using SJCL library, but i want my key to be expired after a scheduled time , so my question here is - is it possible to generate such a key while using SJCL(or any other library may be) , if yes how? provided that the key must be demolished on the client side only without any server interaction? any help is greatly appreciated. thanks 回答1: No, outside help of a third party (keeping the key) or normal programming techniques (i

ECC with SJCL , generate a key that expires automatically

允我心安 提交于 2019-12-12 01:38:44
问题 i have already asked a little similar question here but i am asking it in a different way and a little change. now my question is. is it possible to have a public key on the server side through which i can encrypt the message and have a private key on the client side with which i can decrypt the message , and this private key must be expire automatically after a given period of time (or must be so secured may be in some other way)? so is possible? and if yes, how? provided that i am using

Secure Javascript encryption library?

大憨熊 提交于 2019-12-10 22:17:34
问题 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 enough. I heard about sjcl, but it seems that sjcl only can encrypt the whole data at once. I didn't find a way to encrypt the data blockwise. Because the uploaded files can be very large, this approach isn't feasible. I need something like the java