cryptography

Java BouncyCastle ECC Keys and Self Signed Certificates

孤人 提交于 2019-12-21 16:47:12
问题 I've been scouring the internet for hours looking for a Java example for creating Elliptic Curve (EC) keys and self signed certificates. So far I've only found snippets and examples, many of which do not work. UPDATE: I've made some progress here, here's my code for anybody that might find it useful! Just need to work out how to self sign it now! import org.bouncycastle.asn1.x500.X500Name; import org.bouncycastle.jce.ECNamedCurveTable; import org.bouncycastle.jce.provider.BouncyCastleProvider

Combining All of the Tasks Needed to Verify a PKCS#7 Signature

£可爱£侵袭症+ 提交于 2019-12-21 15:01:01
问题 I've been banging my head against the wall with this problem for about 20 hours now and I am probably missing something easy. However, I've gotten to the point where I think I need help. I have read dozens of explanations for how to do different parts of the problem, but I cannot figure out how to bring them all together. I have a DER-encoded detached PKCS#7 digital signature. The signature conforms to RFC 3852 (Cryptographic Message Syntax). For my project I need to step through each of the

Combining All of the Tasks Needed to Verify a PKCS#7 Signature

蹲街弑〆低调 提交于 2019-12-21 14:59:51
问题 I've been banging my head against the wall with this problem for about 20 hours now and I am probably missing something easy. However, I've gotten to the point where I think I need help. I have read dozens of explanations for how to do different parts of the problem, but I cannot figure out how to bring them all together. I have a DER-encoded detached PKCS#7 digital signature. The signature conforms to RFC 3852 (Cryptographic Message Syntax). For my project I need to step through each of the

Linux Crypto API and linux/crypto.h - Documentation

别来无恙 提交于 2019-12-21 13:07:02
问题 I want to write a C program which makes use of the linux crypto-api for digital signatures. Unfortunately I cannot find good documentation about the linux api and the functions defined in linux/crypto.h (googling doesn't help, man pages for those functions don't exist). So now I wonder if anyone here can help me with a good link, a book would also be appreciated. 2nd short question: All the time within this crypto stuff the term "tfm" comes up, as in a struct crypto_tfm or in functions, but I

EVP_DecryptFinal_ex:bad decrypt when using Node.js

允我心安 提交于 2019-12-21 09:25:32
问题 Using the following node js: var crypto = require('crypto'); var encrypt = function (input, password, callback) { var m = crypto.createHash('md5'); m.update(password); var key = m.digest('hex'); m = crypto.createHash('md5'); m.update(password + key); var iv = m.digest('hex'); console.log(iv); var data = new Buffer(input, 'utf8').toString('binary'); var cipher = crypto.createCipheriv('aes-256-cbc', key, iv.slice(0,16)); var encrypted = cipher.update(data, 'binary') + cipher.final('binary');

Is System.Security.Cryptography namespace supported by the Portable Class Library

被刻印的时光 ゝ 提交于 2019-12-21 09:06:22
问题 I am converting an existing multi-target Silverlight/.NET project to a Portable Class Library project in order to reduce the number of projects that are required to support multiple Microsoft platforms. I have an error in one class that is using the System.Security.Cryptography namespace The type or namespace name 'Cryptography' does not exist in the namespace 'System.Security' (are you missing an assembly reference?) This namespace is available in Silverlight and I am wondering why the

Is SHA1 still secure for use as hash function in PBKDF2?

我的未来我决定 提交于 2019-12-21 08:16:49
问题 As there have been significant advances in the cryptoanalysis of SHA1 it's supposed to be phased out in favor of SHA2 (wikipedia). For use as underlying hash function in PBKDF2, however, it's basically used as a PRNG. As such it should be still secure to use SHA1 as hash for PBKDF2, right? 回答1: None of the currently known weaknesses on SHA-1 has any impact on its security when used in HMAC, a fortiori when used in PBKDF2. For that matter, MD5 would be fine too (but not MD4). However, SHA-1 is

Is SHA1 still secure for use as hash function in PBKDF2?

本小妞迷上赌 提交于 2019-12-21 08:16:21
问题 As there have been significant advances in the cryptoanalysis of SHA1 it's supposed to be phased out in favor of SHA2 (wikipedia). For use as underlying hash function in PBKDF2, however, it's basically used as a PRNG. As such it should be still secure to use SHA1 as hash for PBKDF2, right? 回答1: None of the currently known weaknesses on SHA-1 has any impact on its security when used in HMAC, a fortiori when used in PBKDF2. For that matter, MD5 would be fine too (but not MD4). However, SHA-1 is

Fast pseudorandom number generator for cryptography in C

心不动则不痛 提交于 2019-12-21 08:01:12
问题 I was using the following code to generate sequence of pseudo-random numbers that was used for cryptographic purposes, but then I read somewhere that it may not be very secure. Can someone give me C implementation of a better generator -- the main goal is for this method to be fast. For instance, I did some research and came across Blum Blum Shub method, which would totally kill performance by doing pow(N) calculations. PS. And please don't quote Wikipedia articles w/o C/C++ code. I'm looking

“Bad key” exception for certificates with exportable private key

╄→尐↘猪︶ㄣ 提交于 2019-12-21 07:15:09
问题 I am trying to encrypt and then decrypt files using asymmetric encryption. I've created a test certificate using makecert and installed it into my personal localmachine store. In future I'll have to install this certificate on several servers, that's why I've created it with "-pe" flag, that is, with exportable private key. The certificates has been successfully created and installed, I see the "You have a private key that corresponds to this certificate" note in mmc. Now I am trying to