diffie-hellman

Client-side encryption over HTTP with Diffie-Hellman Key Exchange and AES

岁酱吖の 提交于 2019-11-30 07:18:50
After watching a YouTube video on the Diffie-Hellman Key Exchange , I wanted to try an implementation in JavaScript (Atwood's law). I sketched up an cipher on Node.js with the following rules: Step 1: Client and server agree on a shared key: Client & server start with a 512bit prime public key pK Client generates a 512bit prime private key kC and sends powMod(3, kC, pK) Server generates a 512bit prime private key kS and sends powMod(3, kS, pK) Client & Server use powMod(response, privatekey, pK) as the shared key Step 2: Communication Before a client sends data it is encrypted with the shared

Client-side encryption over HTTP with Diffie-Hellman Key Exchange and AES

浪子不回头ぞ 提交于 2019-11-29 07:56:37
问题 After watching a YouTube video on the Diffie-Hellman Key Exchange, I wanted to try an implementation in JavaScript (Atwood's law). I sketched up an cipher on Node.js with the following rules: Step 1: Client and server agree on a shared key: Client & server start with a 512bit prime public key pK Client generates a 512bit prime private key kC and sends powMod(3, kC, pK) Server generates a 512bit prime private key kS and sends powMod(3, kS, pK) Client & Server use powMod(response, privatekey,

Is there a standardized fixed-length encoding for EC public keys?

元气小坏坏 提交于 2019-11-29 05:38:50
I was wondering if there was (and I hope there is) a standard for public key size for ECDH (Elliptic Curve Diffie-Hellman) and ECDSA (Elliptic Curve Digital Signature Algorithm) for every curve type over prime fields (192, 224, 256, 384 and 521). emboss If you use one of the "named curves" then the public key size is fixed and dependent on the "field size" of your underlying curve. Compressed vs. uncompressed representation Public key sizes further depend on whether the "uncompressed" representation or the "compressed" representation is used. In the uncompressed form, the public key size is

Convert python long/int to fixed size byte array

﹥>﹥吖頭↗ 提交于 2019-11-28 18:35:26
I'm trying to implement RC4 and DH key exchange in python. Problem is that I have no idea about how to convert the python long/int from the key exchange to the byte array I need for the RC4 implementation. Is there a simple way to convert a long to the required length byte array? Update : forgot to mention that the numbers I'm dealing with are 768 bit unsigned integers. I haven't done any benchmarks, but this recipe "works for me". The short version: use '%x' % val , then unhexlify the result. The devil is in the details, though, as unhexlify requires an even number of hex digits, which %x

Diffie-Hellman public key error with Tomcat 7

一曲冷凌霜 提交于 2019-11-28 08:27:01
I successfully set up two Ubuntu machines with Tomcat and SSL certificates. I followed exactly the same procedure with Centos 6, but I'm getting this when I'm trying to connect to the Server (using Opera): Server has a weak, ephemeral Diffie-Hellman public key The connector is the following, and there are no errors in catalina.log: <Connector port="some port number" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="path to jks" keystoreType="JKS" keystorePass="mypass1" keyPass=

Does ECDiffieHellmanCng in .NET have a key derivation function that implements NIST SP 800-56A, section 5.8.1

a 夏天 提交于 2019-11-27 23:42:19
I have a task at hand that requires deriving key material using the key derivation function described in NIST SP 800-56A, section 5.8.1. I'm not an expert in Cryptography so please excuse me if the question is naive. Here's what I've done so far: I have the other party's public key and my private key Now I try to generate the shared secret using ECDH 1.3.132.1.12 using C# (.NET 4) ECDiffieHellmanCng class like so: // The GetCngKey method reads the private key from a certificate in my Personal certificate store CngKey cngPrivateKey = GetCngKey(); ECDiffieHellmanCng ecDiffieHellmanCng = new

How to expand DH key size to 2048 in java 8

Deadly 提交于 2019-11-27 22:31:16
I read a lot of posts saying that in java 8 it is possible to expand the DH key size to 2048. They say it is possible from the system property by changing the value of: jdk.tls.ephemeralDHKeySize to 2048. I tried to figure out where and how to do this and could not find. Where can I find this variable or property? which file? path? I am using windows. This is a system property, so you could set it via -Djdk.tls.ephemeralDHKeySize=2048 as a JVM argument or via System.setProperty within the code. (I haven't checked for this property, but some properties are read only once by the library that

Diffie-Hellman public key error with Tomcat 7

北城以北 提交于 2019-11-27 02:12:11
问题 I successfully set up two Ubuntu machines with Tomcat and SSL certificates. I followed exactly the same procedure with Centos 6, but I'm getting this when I'm trying to connect to the Server (using Opera): Server has a weak, ephemeral Diffie-Hellman public key The connector is the following, and there are no errors in catalina.log: <Connector port="some port number" protocol="org.apache.coyote.http11.Http11Protocol" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth=

How to expand DH key size to 2048 in java 8

谁说胖子不能爱 提交于 2019-11-26 23:10:39
问题 I read a lot of posts saying that in java 8 it is possible to expand the DH key size to 2048. They say it is possible from the system property by changing the value of: jdk.tls.ephemeralDHKeySize to 2048. I tried to figure out where and how to do this and could not find. Where can I find this variable or property? which file? path? I am using windows. 回答1: This is a system property, so you could set it via -Djdk.tls.ephemeralDHKeySize=2048 as a JVM argument or via System.setProperty within

Does ECDiffieHellmanCng in .NET have a key derivation function that implements NIST SP 800-56A, section 5.8.1

江枫思渺然 提交于 2019-11-26 21:34:14
问题 I have a task at hand that requires deriving key material using the key derivation function described in NIST SP 800-56A, section 5.8.1. I'm not an expert in Cryptography so please excuse me if the question is naive. Here's what I've done so far: I have the other party's public key and my private key Now I try to generate the shared secret using ECDH 1.3.132.1.12 using C# (.NET 4) ECDiffieHellmanCng class like so: // The GetCngKey method reads the private key from a certificate in my Personal