public-key-encryption

Can I use PKCS5Padding padding algorithm while decryption for already encrypted data using PKCS7Padding?

久未见 提交于 2019-12-11 11:56:53
问题 I'm replacing PKCS7Padding padding with PKCS5Padding for my AES encryptions. Can I use PKCS5Padding padding algorithm while decryption for already encrypted data using PKCS7Padding? I tried using a sample program on local and somehow it works and didn't give any error. Just want to ensure if we need any sort of Migration for all the existing records. For all the existing records, Do I need to decrypt first using PKCS7Padding and then again encrypt using PKCS5Padding and store it back in the

Encryption Product Keys : Public and Private key encryption

喜你入骨 提交于 2019-12-11 10:36:49
问题 I need to generate and validate product keys and have been thinking about using a public/private key system. I generate our product keys based on a client name (which could be a variable length string) a 6 digit serial number. It would be good if the product key would be of a manageable length (16 characters or so) I need to encrypt them at the base and then distrubute the decryption/validation system. As our system is written in managed code (.NET) we dont want to distribute the encryption

getting Public key of a secure website

风流意气都作罢 提交于 2019-12-11 07:34:18
问题 Other than using browser,How can I get the public key of a websites which use https protocol ? Are there other ways ? Like from the terminal. Update - i want all the ways so that i can choose what fits best for me 回答1: openssl s_client -connect example.com:443 Certificate is between -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- 回答2: Is this OpenSSL command what you are looking for? openssl s_client -connect ${REMHOST}:${REMPORT} 来源: https://stackoverflow.com/questions/11108562

How to create a self signed certificate for authentication in dotnet? [duplicate]

我怕爱的太早我们不能终老 提交于 2019-12-11 06:02:00
问题 This question already has answers here : How can I create a self-signed certificate using C#? (5 answers) Generate and Sign Certificate Request using pure .net Framework (1 answer) Closed 9 months ago . Background: We have to implement a custom authentication mechanism for identifying and authenticate my client's applications and initial details can be found here. Finally, We have come up with the conclusion that we will simply use self-signed certificate for encryption and decryption of JWT

ASN1 Bad tag value met when using CertCreateCertificateContext with WinCrypt

℡╲_俬逩灬. 提交于 2019-12-11 03:52:00
问题 What am I doing wrong here? I keep getting error 0x8009310b (ASN1 bad tag value met) when creating a certificate context. I know the certificate I'm testing with is good. I exported it from the intermediate store using DER, Base-64 and P7B formats. All three scenarios fail. int _tmain(int argc, _TCHAR* argv[]) { const int MAX_CERT_FILE_SIZE=81920; HANDLE certFileHandle; DWORD certEncodedRead = 0L; BYTE certData[MAX_CERT_FILE_SIZE] = {0}; PCCERT_CONTEXT pCertContext = NULL; HCERTSTORE

Unable to do RSA Encryption/Decryption using Crypto++ (isValidCoding is false)

依然范特西╮ 提交于 2019-12-11 02:56:27
问题 I am using Crypto++ to encrypt an array of bytes using RSA. I have followed Crypto++ wiki's samples with no luck getting them to work. Encryption and Decryption in all the samples are done within a single process but I am trying to decrypt the content which is already encrypted in another process. Here is my code: class FixedRNG : public CryptoPP::RandomNumberGenerator { public: FixedRNG(CryptoPP::BufferedTransformation &source) : m_source(source) {} void GenerateBlock(byte *output, size_t

What is special for a private key to be PEM-formatted?

馋奶兔 提交于 2019-12-11 02:13:15
问题 I am trying to use the Google API with a oAuth service account, with Python 3.4. One of the steps is to generate a JSON Web Token, for which I use PyJWT. My code for the generation is the following: # opening the certificate downloaded from the Google API console # it is password protected by the standard password ('notasecret') p12 = OpenSSL.crypto.load_pkcs12(open('certfromgoogle.p12', 'rb').read(), 'notasecret') # extracting the private key from the certificate and dumping it to a PEM #

If public key of two files are same, is it sufficient to conclude that they were signed by the same certificate?

烈酒焚心 提交于 2019-12-10 22:44:10
问题 I am implementing an auto-update mechanism for my software. The msi on the server is signed using signtool. My app downloads the msi and reads the public key of the downloaded msi. If the public key matches the one that is hard coded in the source code, it will execute the msi and update itself. Would this is be sufficient to ensure that no malicious msi gets executed by mistake? My understanding is that a file will have the same public key ONLY if signed by my certificate. Edit: With petey's

PyCrypto: Decrypt only with public key in file (no private+public key)

好久不见. 提交于 2019-12-10 20:26:20
问题 Hello everyone. I am trying to play a bit with RSA public and private keys and encryption/decryption with PyCrypto and I have encountered and issue that seems kind of strange to me (it probably makes a lot of sense the way it's working now, but I don't know much about RSA asymmetric encryption and that's why it's puzzling me). It is the inability I have encountered to decrypt something having only the public key. Here's the thing: I have a server and a client. I want the server to "recognize"

RSA in javascript no longer supports ASCII/byte arrays

一笑奈何 提交于 2019-12-10 13:25:24
问题 I am using rsa.js v1.0 from http://www-cs-students.stanford.edu/~tjw/jsbn/ to encrypt an ASCII string in a browser. The string is actually a 16 byte array that contains a double-length TripleDes key. With rsa v1.0 this works. The byte array is correctly decrypted on the server (using Bouncy Castle or a Thales HSM) as a 16 byte array. e.g. var zpk = hex2a("E0F8AD4092F81FC401E60ECB7F5B8F1A"); var rsa = new RSAKey(); rsa.setPublic(modulus, exponent); var res = rsa.encrypt(zpk); if (res) {