PKCS7 (CMS) Encryption vs RSA Encryption

The difference between PKCS7 (CMS) encryption and RSA encryption lies in their purpose, scope, and how they handle encryption. * Output size differences are described further below. PKCS7 (CMS) Encryption Type: A data format and protocol, not an encryption algorithm itself. Purpose: Used for encrypting data and supporting digital signatures in a standard format. Mechanism: PKCS7 (or CMS, Cryptographic Message […]

RSA – Matching OpenSSL Signature w/ Chilkat

The following problem is common. The goal is to match the signature produced by this OpenSSL command w/ Chilkat: cat in.txt | openssl dgst -sha1 -sign myPrivateKey.pem | openssl enc -base64 The “gotcha” is when the input text file ends with a linefeed character (a single byte having value 0x0A), but the programmer does not realize it. The bytes passed […]

Create Amazon CloudFront Signed URL in VBScript (for ASP)

This sample code snippet is graciously provided by a Chilkat customer: See Also: Chilkat RSA ActiveX Reference Documentation … resource = “http://*********.cloudfront.net/something.jpg” ‘Expiration expiration = 1278680686 ‘Policy policy = “{“”Statement””:[{“”Resource””:””” & resource & _ “””,””Condition””:{“”DateLessThan””:{“”AWS:EpochTime””:” & _ expiration & “}}}]}” ‘Chilkat Component set pkey = Server.CreateObject(“Chilkat.PrivateKey”) ‘Load the private key from an RSA PEM file: private_key = pkey.LoadPemFile(“c:\pk-xxx.pem”) ‘Get the […]

Saving an RSA key pair to a file

Question: I’m having trouble finding a good/complete VB.Net Chilkat example of how to generate an RSA key container with a key pair (private and public) and save that key container to a file. Answer: I think I can clarify.  With 2 points: 1) In actuality, an RSA private key also contains the public-part of the key.  It contains the all […]

Java Create Signature / Chilkat Verify Interoperability

The following Java code produces a digital signature that can be verified using Chilkat RSA.  Links to the Chilkat signature verification examples follow this code.  The Java signature creation code does not use Chilkat to produce the digital signature.  It also demonstrates how to save a generated key (public and private) to DER files that can be used with Chilkat […]

Chilkat 9.0.2 Release Notes

RSA Fixed PEM to XML conversion so that XML is compatible with .NET Framework’s XML requirements. Fixed RSA key generation. In some cases, RSA generated keys were not valid. Verified key acceptance and signature matching between Chilkat, OpenSSL, and .NET MIME / DKIM Fixed DKIM and DomainKeys signature generation. Tested and verified DKIM / DomainKeys signatures in emails sent to […]

OAEP Padding vs. PKCS v1.5 Padding Error

This error occurs if RSA encrypted data using OAEP padding is decrypted with the assumption that PKCS v1.5 padding was used. To solve the problem, set the OaepPadding property = true prior to decrypting. … RSA_decrypt: KeyType: Private InputSize: 128 Padding: PKCS v1.5 ModulusBitLen: 1024 Invalid PKCS v1.5 padding header (1) FoundBlockType: 197 ExpectingBlockType: 2 …