cryptography

Beid : C# CryptoAcquireFailed Error=80090019

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 04:48:12
问题 I'm using Belgian ID card to sign some stuff. The example sign_csp in the SDK failed with this error : CryptoAcquireFailed. Error=80090019 . //Get a context if (!CryptAcquireContext(out hprov, container, provider, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { MessageBox.Show("CryptAcquireContext failed.\n\n(Error=" + Marshal.GetLastWin32Error().ToString("x") + ")"); return; } provider = "Belgium Identity Card CSP" I'm on Windows 7 64 bit. The program is built for x86. Thanks! 回答1: Have you installed

Beid : C# CryptoAcquireFailed Error=80090019

偶尔善良 提交于 2019-12-23 04:48:07
问题 I'm using Belgian ID card to sign some stuff. The example sign_csp in the SDK failed with this error : CryptoAcquireFailed. Error=80090019 . //Get a context if (!CryptAcquireContext(out hprov, container, provider, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) { MessageBox.Show("CryptAcquireContext failed.\n\n(Error=" + Marshal.GetLastWin32Error().ToString("x") + ")"); return; } provider = "Belgium Identity Card CSP" I'm on Windows 7 64 bit. The program is built for x86. Thanks! 回答1: Have you installed

iOS CCCrypt padding issue when encrypting on iPhone, decrypting on .Net server with System.Security.Cryptography

℡╲_俬逩灬. 提交于 2019-12-23 04:47:14
问题 This is a head-scratcher. And it involves encryption making it particularly gnarly! I have Objective-C code which uses CCCrypt to AES 128 encrypt a message on an iPhone which I send using Protocol Buffers and AsyncSockets. The iOS code is as follows: - (NSData *)AES128EncryptWithKey:(const char *)keyPtr { NSUInteger dataLength = [self length]; //See the doc: For block ciphers, the output size will always be less than or //equal to the input size plus the size of one block. //That's why we

How to get entropy from JVM?

不想你离开。 提交于 2019-12-23 04:41:28
问题 Let's say I need good seed to initialize pseudo random generator (PRNG) in Java program and I don't have access to any hardware random generator. How to get entropy from JVM without any user interaction? 回答1: SHA-1 is going to be depreciated The vulnerability is not relevant to CSPRNG construction. How to get entropy from JVM? SecureRandom is a generic facade over various security providers, including OS-specific entropy sources 回答2: You can use generateSeed(int) or getSeed(int) to statically

Angular JS Cryptography. pbkdf2 and iteration

家住魔仙堡 提交于 2019-12-23 04:13:36
问题 I want to convert my string to PBKDF2 with sha512 and iteration count. I did in nodejs by using "pbkdf2" module. how can i achieve the same in angular JS. 回答1: You can use built-in WebCryptographyApi with native support in all modern browsers (http://caniuse.com/#feat=cryptography) This in an example extracted (and modified) from here and here function deriveAKey(password, salt, iterations, hash) { // First, create a PBKDF2 "key" containing the password window.crypto.subtle.importKey( "raw",

Protection of an ECC Key in an Android Application

≡放荡痞女 提交于 2019-12-23 03:57:11
问题 I have done an Android Application using an ECC Key pair. When I have developed it last year, I wanted to create the ECC key in the Android Keystore. Unfortunately, this ECC key is used to generate a session key thanks to ECDH, and ECDH is not supported by Android Keystore (this is what I have been said here: ECDH with key in Android Key Store ) I have followed the recommendations: I have created an AES key in the Android KeyStore and I have used it to encrypt the ECC key before storing it in

RSACryptoServiceProvider and Web.config encryption

心不动则不痛 提交于 2019-12-23 03:32:11
问题 I am new to cryptography. I want to encrypt the connection string section and some other section in the web.config. I know this can be accomplished using RSACryptoServiceProvider. But I am not sure about the Key which is being used by the default RSACryptoServiceProvider and the key size. As per our organization security policy the key size should be 196 bit and we have to share the Key with security team which is used for encryption. When we use the default encryption what will be key used

Why won't 3DES encrypt one block?

冷暖自知 提交于 2019-12-23 03:28:09
问题 I'm trying to implement this question i asked in the past Securely Encrypt 64bits w/o per element overhead? In the immediate window i entered TripleDES.Create().LegalBlockSizes.First() and got {System.Security.Cryptography.KeySizes} MaxSize: 64 MinSize: 64 SkipSize: 0 64bits/8bits per byte is 8bytes. Exactly what length a long is. Anyways i run it through the code below and the exception throws. The length of the block is 16bytes. Not what i want to have... I would ask how to change it to

Encryption/ Decryption time of AES, Blowfish, and PBE

本小妞迷上赌 提交于 2019-12-23 02:36:38
问题 I've developed an application to encrypt / decrypt a file. The user can choose from 3 different algorithms i.e. AES or Blowfish or PBE. And then the encryption, decryption and total time would be displayed. I'm trying to compare the efficiency of the 3 algos w.r.t the element of "time". My professor at college has told me to study the time complexity of these 3 algorithms. What are the other ways to determine algorithm efficiency w.r.t speed in addition to calculating the time complexity? Is

Fix for Security “Crypto” on Nougat does not work for Pie

扶醉桌前 提交于 2019-12-23 02:02:45
问题 A user run my application in Android Pie, he got the crash.There was fix for Android N (fix from varotariya vajsi): SecureRandom sr = SecureRandom.getInstance("SHA1PRNG", new CryptoProvider()); ... public final class CryptoProvider extends Provider { /** * Creates a Provider and puts parameters */ public CryptoProvider() { super("Crypto", 1.0, "HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)"); put("SecureRandom.SHA1PRNG", "org.apache.harmony.security.provider.crypto.SHA1PRNG