CryptoAPI programming
(1) Microsoft Encryption Service System
The structure of the Microsoft cryptographic Service System CryptoAPI as shown in the following illustration, the Microsoft Encryption Service system consists of three-tier architecture and two interfaces, namely the application layer, the operating system layer (OS), the cryptographic service provider layer (cryptographic service PROVIDER,CSP)
---- Encryption is too complex.AlgorithmImplementation is very difficult, so in the past, many applicationsProgramOnly simple encryption technologies can be used. The result is that the encrypted data can be easily decrypted. By using the encryption application interface (cryptography API) or CryptoAPI provided by Microsoft, you can easily add powerful encryption functions to your application without considering basic algorithms. This article will giv
The encryption is too complex.AlgorithmImplementation is very difficult, so in the past, many applicationsProgramOnly simple encryption technologies can be used. The result is that the encrypted data is easily decrypted. However, you can use the encryption application interface (cryptography API) provided by Microsoft or CryptoAPI to conveniently Add powerful encryption functions to your application without considering basic algorithms. This article w
/xdTHXY6+CkfVAk4oYBB56a9AD\n");a.append("t1XOoAUa42fJdit6+7ssLLTZkZLNsQl6qsuTdv64dIMda4C6NnUsKDfjWGa+0vs3\n");a.append("VjVNsUC5jo4qRc4XmBvJIx6e5M420sPj2Gi/+ssgmaXK+zUWzowIoMU=\n");a.append("-----END CERTIFICATE-----\n");}
2) the CryptoAPI is consistent with the OpenSSL public/private key. If you remove the PEM header and tail, you can directly use it without encryption.
Certificate:
void readCertBase64(string a){a = "MIIGVTCCBT2gAwIBAgIKGCyzsAAAAAAA
After Encryption By CryptoAPI is used last time, OpenSSL is implemented this time.
Motivation: After using CryptoAPI to create windows IE, Firefox, and chrome encryption controls, we need to add encrypted information to interact with Android.
Previously, we mentioned the process of porting OpenSSL to Android. Here we will not mention how Android calls OpenSSL,
The two methods mentioned in Article 9th that a
Because overly complex cryptographic algorithms are difficult to implement, in the past, many applications used only very simple encryption techniques, and the result is that encrypted data can easily be deciphered. Using the cryptographic application interface (that is, the cryptography API) provided by Microsoft, or CryptoAPI, makes it easy to add powerful encryption capabilities to your application without having to consider basic algorithms. This
In this era of information explosion, we have to be vigilant about the security of the message. As a way of guaranteeing the security of data information, encryption is more and more concerned by people.
Next, I'll share some of my superficial understanding of Microsoft CryptoAPI with you, and let me know what's wrong.
First, the encryption method:
In the beginning, computer research is to solve the German password, people did not think of the comp
Microsoft CryptoAPI encryption technology (1)Author: cuick
Download sample source code
In this age of information explosion, we have to be vigilant against information security. Encryption, as a way to ensure data information security, has attracted more and more attention.Next, I will share my superficial understanding of Microsoft CryptoAPI with you. What's wrong with this.
I. encryption method:
At the be
Microsoft CryptoAPI encryption technology (2)Author: cuick
Download sample source code
Last time we talked about the composition of Microsoft CryptoAPI and the use of session keys. Next we will take a look at the use of public/private key pairs, hash algorithms, digital signatures, and other technologies.
I. public key encryption technology
Public key encryption technology uses two different keys: public ke
Read into a CER file, CertCreateCertificateContext generate Cert_context. Cert_context there is a cert_info,cert_info in this data structure that has a subjectpublickeyinfo, Subjectpublickeyinfo is a data segment of the Publickey_info type , which holds the ID of the algorithm and the DER encoded public key. With this der Code, we can use other tools (such as OpenSSL) to parse the parameters of the public key. Unfortunately, the interfaces defined by CryptoA
Microsoft's CryptoAPI is a recommended encryption API for PKI. It provides application developers with standard encryption interfaces when using encryption, authentication, and other security services in Win32 environments. CryptoAPI is located between the application and the CSP (Cryptographic Service Provider) (see figure 1 ).
The Programming Model of
Please pay attention to the previous series of articlesDecode X509 certificate content using CryptoAPIParsing X509 Certificate Primitives using CryptoAPIThrough the previous article, we can use CryptoAPI to decode the X509 certificate file and parse the basic key of the certificate, this time we try to get the hash value of the certificate through CryptoAPI . The hash value of the certificate, also called t
Last time we talked about the composition of Microsoft CryptoAPI and the use of session keys. Next we will look at the use of public-private key pairs, hash algorithm, digital signature and other technologies.
First, public key encryption technology
Public key cryptography uses two different keys: the public key and the private key. The private key must be securely secured so that it cannot be known to outsiders, and the public key can tell anyone a
(Rsapubkey); N of Public private key (note byte order)p + = ((* (rsapubkey*) p). Bitlen)/8; P (note byte order) of the private keyp + = ((* (rsapubkey*) p). Bitlen)/16; Q of the private key (note byte order)p + = ((* (rsapubkey*) p). Bitlen)/16; DP of the private key (note byte order)p + = ((* (rsapubkey*) p). Bitlen)/16; DQ of the private key (note byte order)p + = ((* (rsapubkey*) p). Bitlen)/16; Qu of the private key (note byte order)p + = ((* (rsapubkey*) p). Bitlen)/16; D of the private ke
In the previous article, "CSP: Using CryptoAPI to decode X509 certificate content," describes how to use CryptoAPI to decode the certificate file to get the pccert_context method of the certificate context handle. Let's go on to get the desired certificate entry through the certificate context handle. This article first describes how to get the base entry for a certificate, and later an article explains how
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.