sjcl

How to use Elliptic Curves Diffie-Hellman with SJCL in JS and OpenSSL in Ruby

陌路散爱 提交于 2019-12-08 08:51:09
问题 Using Elliptic-Curves Diffie-Hellman, I want to connect SLCL - JS (documentation) on client and OpenSSL - Ruby (documentation) on server. I found a similar question here but it wasn't really answered properly and it was also not what I am really looking for since it uses sjcl.ecc.elGamal.generateKeys(384, 10) whereas I am hoping of using sjcl.ecc.curves['c384'] <- NIST Nevertheless, I still used and modified his code to test because I had problems using sjcl.ecc.curves['c384'] producing a

How to use Elliptic Curves Diffie-Hellman with SJCL in JS and OpenSSL in Ruby

杀马特。学长 韩版系。学妹 提交于 2019-12-06 15:31:49
Using Elliptic-Curves Diffie-Hellman, I want to connect SLCL - JS (documentation) on client and OpenSSL - Ruby (documentation) on server. I found a similar question here but it wasn't really answered properly and it was also not what I am really looking for since it uses sjcl.ecc.elGamal.generateKeys(384, 10) whereas I am hoping of using sjcl.ecc.curves['c384'] <- NIST Nevertheless, I still used and modified his code to test because I had problems using sjcl.ecc.curves['c384'] producing a single public point-key, and this is what I came up with. //Javascript keypair = sjcl.ecc.elGamal

【HAVENT原创】前端使用 jsrsasign 进行 RSA 加密、解密、签名、验签

☆樱花仙子☆ 提交于 2019-12-03 02:52:01
最近因项目需求,需要配合 JAVA 后端返回的签名,在 H5 网页中做验签功能。网上搜了一下发现了 jsrsasign 满足需求,所以顺便研究了一下 jsrsasign 。 首先去官网下载压缩包,解压后只需要引用其中的 jsrsasign-all-min.js 文件即可。 <!--引入jsrsasign.js--> <script src="./jsrsasign-all-min.js"></script> 初始化一下公钥和私钥(实际可以根据业务需求只使用公钥或者私钥) // 公钥 let pk="-----BEGIN PUBLIC KEY-----\n" + "MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMF4B4aDnV6j+yXiiXBYJjHM8sEgRicQ\n" + "TsRndPKocf4PyNTcd9D1046wRMdtV5cijT3oVzBXQYupN+VXmMiM7MMCAwEAAQ==\n" + "-----END PUBLIC KEY-----"; // 私钥 let priK = "-----BEGIN PRIVATE KEY-----\n" + "MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEAwXgHhoOdXqP7JeKJ\n" +

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

天涯浪子 提交于 2019-12-02 17:33:37
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? I did a presentation last year titled Developer's Guide to JavaScript and Web Cryptography and have the demo site online at https://jswebcrypto.azurewebsites.net/ This includes simple Hash, HMAC, PBKDF2 and AES examples for OpenSSL command line (as a baseline) SJCL , CryptoJS , Node.js Crypto , and even W3C Web Cryptography API Here are the SJCL examples: Hash var

Elliptic curve cryptography with SJCL in JS and OpenSSL in Ruby

痞子三分冷 提交于 2019-11-30 14:19:36
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 abandoned at the moment, I have used a fork , which has key serialization support and a demo for easier understanding. First, I generate an ECC key pair in JS: keypair = sjcl.ecc.elGamal.generateKeys(384, 10); document.writeln(JSON.stringify(keypair.pub.serialize())); This outputs something like: {"point":[1110230655,241884220,775655552,-849225963,

Decryption of AES created with sjcl.js in ruby

旧城冷巷雨未停 提交于 2019-11-30 05:44:49
问题 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 any other language that has a crypto library that has support for AES. Here is what I am doing in javascript: sjcl.encrypt('stack-password', 'overflow-secret') And this is what I get in return: { "iv": "Tbn0mZxQcroWnq4g/Pm+Gg", "v": 1, "iter": 1000

Elliptic curve cryptography with SJCL in JS and OpenSSL in Ruby

試著忘記壹切 提交于 2019-11-29 19:22:26
问题 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 abandoned at the moment, I have used a fork, which has key serialization support and a demo for easier understanding. First, I generate an ECC key pair in JS: keypair = sjcl.ecc.elGamal.generateKeys(384, 10); document.writeln(JSON.stringify(keypair.pub