key-management

Android Secure Storage

邮差的信 提交于 2019-11-30 06:53:14
问题 I want to store some small but critical piece of information such as AES keys in my Android application. What would be the recommended way to do this? I do not want to hardcode keys as part of my application. I look at KeyStore but it does not really solve my problem. It can store my keys given that I can provide a password. Then I need to find a secure place to store this password which is same as my original problem. Is there a built in Android class to perform this task? Or should I look

programmatically import .cer certificate into keystore

浪尽此生 提交于 2019-11-30 03:46:25
How can I import a .p12 certificate from the classpath into the java keystore? First I used the InstallCert https://code.google.com/p/java-use-examples/source/browse/trunk/src/com/aw/ad/util/InstallCert.java and did some changes so the server certificate will be imported into the keystore in the java install directory. This works fine but now I want to load a certificate from my classpath. EDIT: I just use a .cer certificate, see next answer Pali The answer: InputStream certIn = ClassLoader.class.getResourceAsStream("/package/myCert.cer"); final char sep = File.separatorChar; File dir = new

Where can I learn about proven methods for sharing cryptographic keys?

…衆ロ難τιáo~ 提交于 2019-11-29 18:22:50
问题 Suppose that a group wants to encrypt some information, then share the encryption key among the group members in a way that requires the consensus of the group to decrypt the information. I'm interested in a variety of scenarios where the breadth of consensus ranges from unanimity to an absolute majority. A useful technique can apply to symmetric keys, private keys, or both. I could take a crack at rolling my own method, as I'm sure many SO members could. But for the purposes of this question

Android Secure Storage

ぐ巨炮叔叔 提交于 2019-11-28 23:08:19
I want to store some small but critical piece of information such as AES keys in my Android application. What would be the recommended way to do this? I do not want to hardcode keys as part of my application. I look at KeyStore but it does not really solve my problem. It can store my keys given that I can provide a password. Then I need to find a secure place to store this password which is same as my original problem. Is there a built in Android class to perform this task? Or should I look for third party libraries? Using NDK is also acceptable for me. Update: I was hoping to find an Android

How to retrieve my public and private key from the keystore we created

旧城冷巷雨未停 提交于 2019-11-28 07:01:17
My task is the following: Retrieve my public and private key from the keystore I created. Use these keys to encrypt a paragraph using my RSA 2048-bit public key. Digitally sign the result using the DSA-SHA-1 signature algorithm. Save the digital signature output on a file called output.dat . The program below is throwing error : "java.security.InvalidKeyException: No installed provider supports this key: sun.security.provider.DSAPublicKeyImpl". import java.security.*; import java.security.KeyStore.*; import java.io.*; import java.security.PublicKey; import java.security.PrivateKey; import

How to read a RSA public key in PEM + PKCS#1 format

人走茶凉 提交于 2019-11-27 19:42:46
I have a RSA public key in PEM format + PKCS#1(I guess): -----BEGIN RSA PUBLIC KEY----- MIGJAoGBAJNrHWRFgWLqgzSmLBq2G89exgi/Jk1NWhbFB9gHc9MLORmP3BOCJS9k onzT/+Dk1hdZf00JGgZeuJGoXK9PX3CIKQKRQRHpi5e1vmOCrmHN5VMOxGO4d+zn JDEbNHODZR4HzsSdpQ9SGMSx7raJJedEIbr0IP6DgnWgiA7R1mUdAgMBAAE= -----END RSA PUBLIC KEY----- I want to get the SHA1 digest of its ASN1 encoded version in Python. The first step should be to read this key, but I failed to do it in PyCrypto: >> from Crypto.PublicKey import RSA >> RSA.importKey(my_key) ValueError: RSA key format is not supported The documentation of PyCrypto says PEM +

How to retrieve my public and private key from the keystore we created

无人久伴 提交于 2019-11-27 01:41:18
问题 My task is the following: Retrieve my public and private key from the keystore I created. Use these keys to encrypt a paragraph using my RSA 2048-bit public key. Digitally sign the result using the DSA-SHA-1 signature algorithm. Save the digital signature output on a file called output.dat . The program below is throwing error : "java.security.InvalidKeyException: No installed provider supports this key: sun.security.provider.DSAPublicKeyImpl". import java.security.*; import java.security

How to read a RSA public key in PEM + PKCS#1 format

不羁岁月 提交于 2019-11-26 19:50:36
问题 I have a RSA public key in PEM format + PKCS#1(I guess): -----BEGIN RSA PUBLIC KEY----- MIGJAoGBAJNrHWRFgWLqgzSmLBq2G89exgi/Jk1NWhbFB9gHc9MLORmP3BOCJS9k onzT/+Dk1hdZf00JGgZeuJGoXK9PX3CIKQKRQRHpi5e1vmOCrmHN5VMOxGO4d+zn JDEbNHODZR4HzsSdpQ9SGMSx7raJJedEIbr0IP6DgnWgiA7R1mUdAgMBAAE= -----END RSA PUBLIC KEY----- I want to get the SHA1 digest of its ASN1 encoded version in Python. The first step should be to read this key, but I failed to do it in PyCrypto: >> from Crypto.PublicKey import RSA >> RSA

How to properly do private key management

耗尽温柔 提交于 2019-11-26 04:38:11
问题 Has anyone got practical experience or a reference for a scheme that implements a key management scheme that would comply with the PCI DSS security standard? There are obviously quite a few implementations around given the number of companies compliant with PCI DSS but trying to find details of them is tough. When it gets down to storing private data the discussion normally stops at which encryption algorithm to use. After that there\'s normally a statement about appropriately storing the