private-key

hash_hmac sha512 authentication in python

安稳与你 提交于 2019-11-30 23:42:09
I'm trying to write python authentication bot for: https://comkort.com/page/private_api There is no full php example. I'm guess somebody could put it here. There is only snippet of php code: $query_string = http_build_query($_POST, '', '&'); $ethalon_sign = hash_hmac("sha512", $query_string, $api_secret_key); How to write authentication on python with hash_hmac sha512 ? I want to extract my open orders POST https://api.comkort.com/v1/private/order/list . My current variant is: import hashlib import hmac import requests import time privateKey = b'myprivatekey' publicKey = 'my public key' url =

Get public key from private in Java

浪尽此生 提交于 2019-11-30 22:38:35
问题 I remember do this long time ago with OpenSSL, but I want to know if it's possible and how, I've never used Cryptography on java. 回答1: You cannot generate either key directly from the other. It is mathematically impossible. If you had a key blob that contained both the public and private keys, you could extract either one of them with relative ease. EDIT, 2017: Many years and a much better understanding of crypto later, and it's now clear to me that this answer isn't really correct. To quote

Any concern to share private key for distribution certificate among different group under a team account in itune provisioning portal

人走茶凉 提交于 2019-11-30 21:28:22
We are a large university and have a single team account in apple itunes provisioning portal. We have serval different groups developing iOS apps, which will be published under the team account (university name). It seems apple only allows to create one distribution certificate. To publish apps, each group will need the private key to sign the app. If we choose to share the private key among all groups, is there any concern? Someone also suggested revoking the current certificate. I understand it will not affect the current apps in store. But others will have to revoke the certificate again

Decrypt with PrivateKey X.509 Certificate

纵然是瞬间 提交于 2019-11-30 19:52:52
I have a problem to decrypt a message usgin X.509 Certificate. I generate my certificate with makecert with this options: makecert -r -pe -n "CN=MyCertificate" -ss CA -sr CurrentUser -a sha1 -sky signature -cy authority -sv CA.pvk CA.cer And the PrivateKey was "mypassword". My problem is when I want to decrypt a message encrypt with previous certificate in c#. I found this class http://blog.shutupandcode.net/?p=660 , but in the X509Decrypt method allways the PrivateKey is null. public static byte[] X509Decrypt(byte[] data, string certificateFile, string password) { // load the certificate and

Restore RSA private key by modulus, public and private exponents using Java Security

泄露秘密 提交于 2019-11-30 19:47:59
问题 I'm trying to find Java (native or BouncyCastle provider) implementation for generating a RSA private key in PKCS#1 using given params {e,n,d}. There is paper by Dan Boneh that describes an algorithm for doing so. The solution is available in PyCrypto (Python), as well as there is a standalone utility posted by Mounir IDRASSI that converts RSA keys between the SFM format (n,e,d) and CRT format (p,q,dp,dq,u), and the other way around. However I was not able to find anything ready to use for

Use PEM encoded RSA private key in .NET

送分小仙女□ 提交于 2019-11-30 18:25:08
问题 I have a private key which looks like this: -----BEGIN RSA PRIVATE KEY----- Some private key data -----END RSA PRIVA I need to use this key in my C# project, but I couldn't find any example how to use key in this format. Thanks 回答1: step 1 get "Some private key data" content.remove -----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY-----, Removes all line symbols("\n"); step 2. parse key to RSA. private RSACryptoServiceProvider CreateRsaProviderFromPrivateKey(string privateKey) { var

How to get the RSA public-key from private-key Object in Java

烈酒焚心 提交于 2019-11-30 16:32:29
How to get the related public-key object java.security.PublicKey out of a private-key Object java.security.PrivateKey in the RSA cryptosystem. Java is able to create a public key by using the modulus and exponent: RSAPublicKeySpec keySpec = new RSAPublicKeySpec(modulus, exponent); kf.generatePublic(keySpec); So we need to extract these values out of the private key: KeyFactory kf = KeyFactory.getInstance("RSA"); RSAPrivateKeySpec priv = kf.getKeySpec(privateKey, RSAPrivateKeySpec.class); The RSAPrivateKeySpec -Object now contains the modulus we need, but the exponent is not the one we need for

How to get the RSA public-key from private-key Object in Java

拟墨画扇 提交于 2019-11-30 16:18:19
问题 How to get the related public-key object java.security.PublicKey out of a private-key Object java.security.PrivateKey in the RSA cryptosystem. 回答1: Java is able to create a public key by using the modulus and exponent: RSAPublicKeySpec keySpec = new RSAPublicKeySpec(modulus, exponent); kf.generatePublic(keySpec); So we need to extract these values out of the private key: KeyFactory kf = KeyFactory.getInstance("RSA"); RSAPrivateKeySpec priv = kf.getKeySpec(privateKey, RSAPrivateKeySpec.class);

Using AsymmetricAlgorithm Private and Public key with RSA C#

早过忘川 提交于 2019-11-30 15:24:32
I have two AsymmetricAlgorithm objects that contain an RSA Private and RSA Public key. The private key was retrieved out of the Windows-MY keystore and the Public key from a user's certificate. How can I use these keys along with RSACryptoServiceProvider to encrypt data using the RSA algorithm in C#? In other words, how can I specify that I want to use keys that I already have? #region "RSA Encrypt/Decrypt" public string RSAEncrypt(string str, string publicKey) { //---Creates a new instance of RSACryptoServiceProvider--- try { RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(); //--

How to convert PKCS#8-formatted PEM private key to the traditional format?

橙三吉。 提交于 2019-11-30 13:59:27
问题 From OpenSSL 1.0 change log: Make PKCS#8 the default write format for private keys, replacing the traditional format. This form is standardised, more secure and doesn't include an implicit MD5 dependency. [Steve Henson] However, I need the private key file in the previous, traditional format. Is it possible to convert the pem file from PKCS#8 to the traditional format (using OpenSSL.exe app)? Thank you very much! 回答1: Succeeded to solve that in that way - the request: openssl req