cryptography

Montgomery multiplication VHDL Implementation

若如初见. 提交于 2019-12-24 10:49:48
问题 I am trying to create a modular arithmetic operation in this case: x*y mod n As far as I have read the fastest way to do it is using the Montgomery multiplication, but I cant understand how that is actually done in other to implement it in hardware using VHDL. Has someone been able to do it or have any library that enables me to use it? 回答1: A basic shift and add modular multiplication can be found here as a part of this open cores project. Here's another project that is using the Montgomery

Python AES import error Please

只愿长相守 提交于 2019-12-24 10:36:07
问题 I have AES inside Cipher inside Crypto(Python27\Lib\Crypto\Cipher\AES module) When I try to import AES from Crypto.Cipher import AES I get the following error: Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> from Crypto.Cipher import AES File "C:\Python27\lib\Crypto\Cipher\AES.py", line 50, in <module> from Crypto.Cipher import _AES ImportError: cannot import name _AES But I can import another module like from Crypto.Cipher import blockalgo working fine. So I'm

CryptExportKey in C#

馋奶兔 提交于 2019-12-24 10:32:32
问题 What is the C# equivalent to this CryptExportKey call? CryptExportKey(hKey, hPublicKey, SIMPLEBLOB, 0, lpData, &nSize); and it would be nice if you can give a description on your C# code where hKey, hPublicKey and SIMPLEBLOB (or their equivalent in C#) are being used 回答1: I think your best bet is handling it manually. The SIMPLEBLOB format is BLOBHEADER blobheader; ALG_ID algid; BYTE encryptedkey[rsapubkey.bitlen/8]; where BLOBHEADER is BYTE bType; BYTE bVersion; WORD reserved; ALG_ID

java 11 HttpClient leads to endless SSL loop even with disabled TLSv.1.3

女生的网名这么多〃 提交于 2019-12-24 10:24:46
问题 I facing a problem with standard java http client. By some reason that I don't know yet it go into infinite loop and utilize all cpus I have. Below is an example stack trace and a method where the infinity loop is running. "HttpClient-1-Worker-34" #232 daemon prio=5 os_prio=0 cpu=37704.71ms elapsed=231.22s tid=0x00007f1580279000 nid=0x31fc runnable [0x00007f1575059000] java.lang.Thread.State: RUNNABLE at jdk.internal.net.http.common.SSLFlowDelegate$Writer.processData(java.net.http@11.0.1

PKCS#10 request for a object key pair from PKCS#11

♀尐吖头ヾ 提交于 2019-12-24 08:42:21
问题 I have a RSA 1024 key pair generated using standard call from PKCS#11. I need to generate a PKCS#10 CSR for the public key. MS has the IEnroll4 dll which will allow to raise a CSR using createRequestWStr. The samples indicate that you need to generate a new key pair(a container with 2 objects in MS CAPI) and MS automatically gives the the public key context for csr generation. In my case, I already have a key pair generated using pkcs#11(as 2 objects but no key container). MS dll is not

Using PBKDF2 key derivation to properly create user-readable salt with rust-crypto

谁说胖子不能爱 提交于 2019-12-24 08:38:48
问题 I am currently working on creating a client for Standard File, which involves using PBKDF2 for security. I'm using rust-crypto , although I have experimented with ring and rust-openssl. First, you retrieve a salt, cost and version number from the server through the /auth/param endpoint. I have these serialized into a struct with Serde. #[derive(Serialize, Deserialize, Clone, Debug)] pub struct PWHash { pub pw_salt: String, pub pw_cost: u32, pub version: String, } Previous clients I have

Decrypt AES-256-CTR payloads in Python when encrypted from Nodejs

时光怂恿深爱的人放手 提交于 2019-12-24 07:37:17
问题 I wrote an application in Nodejs that encrypts user passwords using AES-256-CTR : const crypto = require('crypto') const masterkey = 'azertyuiopazertyuiopazertyuiopaz' const cipher = crypto.createCipher('aes-256-ctr', masterkey) console.log(cipher.update('antoine', 'utf8', 'hex') + cipher.final('hex')) //=> 6415bc70ad76c6 It then gets persisted into a database and now I'm trying to decipher it from a Python script using PyCrypto like this : masterkey = 'azertyuiopazertyuiopazertyuiopaz'

Programmatically synchronizing keys generated by HSM clients with the RFS server

匆匆过客 提交于 2019-12-24 07:36:03
问题 I am using PKCS11Interop to perform Key Management operations inside an HSM. The HSM I am using is a network HSM, Thales N-Shield. Here are the details of my setup: 1- HSM 1- RFS Server 3- Clients My software application is distributed and is hosted over the 3 clients. The key will be generated in one of the clients and could be used by the application components present in other clients. However, I have noticed that a key generated in one client machine is not accessible to other client

DES encryption function give me a cipher text that is wrong

痴心易碎 提交于 2019-12-24 07:19:35
问题 I have written the DES algorithm in haskell, but when i tried it, it doesn't give the correct output, i have tested every function on its own, they seem to work correctly, i have taken a message to encrypt: plainText = 123456ABCD132536 with the key = AABB09182736CCDD, when encrypted with DES it suppose to give me as output cipherText = C0B7A8D05F3A829C. The subkeys are all (K1..K16) correct, l0, r0 are correct as well , so are l1, r1 , l2, r2 , but at round 3 , i get r3 = B00A9591 , but its

How to create a hash function to mask confidential informations?

馋奶兔 提交于 2019-12-24 06:51:39
问题 In the current project I would like to create my own hash function but so far haven't gained much theoretical background on hashing principle. I would be very thankful if anyone of you could suggest any useful resource about the theory of hashing, cryptography and practical implementations of hash functions. Thank you! P.S. As hashing blocks of informations in this case is a part of larger research project I would like to create a hash function on my own and this way learn the principle