In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
How to make self-certification certificate
Secure transmission between general networks is inseparable from SSL,SSL, which represents the application of public key encryption (PKI) technology.
To put it simply, using public key encryption, each transmission process requires two keys, namely the encryption key and the unsecret key.
The provider of the data, that is, the starting point of the data transmission, encrypts the data. After the transmission, the key used for encryption is public, which is called the public key.
The receiver of the data decrypts the received data, and the key is not disclosed, which is called the private key (private key).
In SSL, public key and private key are paired, that is, one public key corresponds to one private key (other models / algorithms can also achieve one-to-many, many-to-many key matching), which is calculated by the receiver of the data, and the public key is notified to the other party.
Therefore, in practical application, to complete a data exchange that is one-way readable and writable, two key pairs are required, each of which holds a public key and a private key.
Before starting the transmission, during the establishment of the connection, the public key can be transmitted in clear text (SSL's handshake protocol)
As long as the private key is so complex that it is difficult to crack, the transmission can maintain both security and arbitrariness, that is, without prior exchange, using the existing network, even if there is monitoring, as long as the private key is kept secret, the secure transmission of data can be realized.
However, the problem is that if the public key is replaced when transmitted to another party during malicious monitoring, it is equivalent to establishing two false secure connections between the listener and both sides of the transmission to obtain the content of the transmission.
To solve this problem, SSL's solution uses the authentication mechanism for the data provider.
The receiver of the data retains some CA information in advance, and the data server needs to authenticate its public key to the certification body. The receiver uses the information of CA and the authentication information of the data server to parse and verify the validity of the public key of the server.
CA is regarded as the source of the whole process. CA can be an authoritative certification body or can be customized to ensure the smooth implementation of the SSL mechanism.
In the whole mechanism, the information required by the data receiver (client)
CA.crt
Server.crt
Server.public_key
Can be generated by openssl command execution
Openssl genrsa-des3-out ca.key 1024
Openssl req-new-key ca.key-out ca.csr
Cp ca.key ca.key.org
Openssl rsa-in ca.key.org-out ca.key
Openssl x509-req-days 365-in ca.csr-signkey ca.key-out ca.crt
Generate server.key using the same method
Authenticate it with ca information
Openssl x509-req-days 3650-in server.csr-CA ca.crt-CAkey ca.key-CAcreateserial-out server.crt
Additional calculation tool parameters
Openssl dHParam-outform PEM-out dh2024.pem 1024
Reference article
Http://www.akadia.com/services/ssh_test_certificate.html
Zur ü ck
How to create a self-signed SSL Certificate...
... Which can be used for testing purposes or internal usage
Overview
The following is an extremely simplified view of how SSL is implemented and what part the certificate plays in the entire process.
Normal web traffic is sent unencrypted over the Internet. That is, anyone with access to the right tools can snoop all of that traffic. Obviously, this can lead to problems, especially where security and privacy is necessary, such as in credit card data and bank transactions. The Secure Socket Layer is used to encrypt the data stream between the web server and the web client (the browser).
SSL makes use of what is known as asymmetric cryptography, commonly referred to as public key cryptography (PKI). With public key cryptography, two keys are created, one public, one private. Anything encrypted with either key can only be decrypted with its corresponding key. Thus if a message or data stream were encrypted with the server's private key, it can be decrypted only using its corresponding public key, ensuring that the data only could have come from the server.
If SSL utilizes public key cryptography to encrypt the data stream traveling over the Internet, why is a certificate necessary? The technical answer to that question is that a certificate is not really necessary-the data is secure and cannot easily be decrypted by a third party. However, certificates do serve a crucial role in the communication process. The certificate, signed by a trusted Certificate Authority (CA), ensures that the certificate holder is really who he claims to be. Without a trusted signed certificate, your data may be encrypted, however, the party you are communicating with may not be whom you think. Without certificates, impersonation attacks would be much more common.
Step 1: Generate a Private Key
The openssl toolkit is used to generate an RSA Private Key and CSR (Certificate Signing Request). It can also be used to generate self-signed certificates which can be used for testing purposes or internal usage.
The first step is to create your RSA Private Key. This key is a 1024 bit RSA key which is encrypted using Triple-DES and stored in a PEM format so that it is readable as ASCII text.
Openssl genrsa-des3-out server.key 1024
Generating RSA private key, 1024 bit long modulus
... +
. +
E is 65537 (0x10001)
Enter PEM pass phrase:
Verifying password-Enter PEM pass phrase:
Step 2: Generate a CSR (Certificate Signing Request)
Once the private key is generated a Certificate Signing Request can be generated. The CSR is then used in one of two ways. Ideally, the CSR will be sent to a Certificate Authority, such as Thawte or Verisign who will verify the identity of the requestor and issue a signed certificate. The second option is to self-sign the CSR, which will be demonstrated in the next section.
During the generation of the CSR, you will be prompted for several pieces of information. These are the X.509 attributes of the certificate. One of the prompts will be for "Common Name (e.g.YOUR name)". It is important that this field be filled in with the fully qualified domain name of the server to be protected by SSL. If the website to be protected will be https://public.akadia.com, then enter public.akadia.com at this prompt. The command to generate the CSR is as follows:
Openssl req-new-key server.key-out server.csr
Country Name (2 letter code) [GB]: CH
State or Province Name (full name) [Berkshire]: Bern
Locality Name (eg, city) [Newbury]: Oberdiessbach
Organization Name (eg, company) [My Company Ltd]: Akadia AG
Organizational Unit Name (eg, section) []: Information Technology
Common Name (eg, your name or your server's hostname) []: public.akadia.com
Email Address []: martin dot zahn at akadia dot ch
Please enter the following 'extra' attributes
To be sent with your certificate request
A challenge password []:
An optional company name []:
Step 3: Remove Passphrase from Key
One unfortunate side-effect of the pass-phrased private key is that Apache will ask for the pass-phrase each time the web server is started. Obviously this is not necessarily convenient as someone will not always be around to type in the pass-phrase, such as after a reboot or crash. Mod_ssl includes the ability to use an external program in place of the built-in pass-phrase dialog, however, this is not necessarily the most secure option either. It is possible to remove the Triple-DES encryption from the key, thereby no longer needing to type in a pass-phrase. If the private key is no longer encrypted, it is critical that this file only be readable by the root user! If your system is ever compromised and a third party obtains your unencrypted private key, the corresponding certificate will need to be revoked. With that being said, use the following command to remove the pass-phrase from the key:
Cp server.key server.key.org
Openssl rsa-in server.key.org-out server.key
The newly created server.key file has no more passphrase in it.
-rw-r--r-- 1 root root 745 Jun 29 12:19 server.csr
-rw-r--r-- 1 root root 891 Jun 29 13:22 server.key
-rw-r--r-- 1 root root 963 Jun 29 13:22 server.key.org
Step 4: Generating a Self-Signed Certificate
At this point you will need to generate a self-signed certificate because you either don't plan on having your certificate signed by a CA, or you wish to test your new SSL implementation while the CA is signing your certificate. This temporary certificate will generate an error in the client browser to the effect that the signing certificate authority is unknown and not trusted.
To generate a temporary certificate which is good for 365 days, issue the following command:
Openssl x509-req-days 365-in server.csr-signkey server.key-out server.crt
Signature ok
Subject=/C=CH/ST=Bern/L=Oberdiessbach/O=Akadia AG/OU=Information
Technology/CN=public.akadia.com/Email=martin dot zahn at akadia dot ch
Getting Private key
Authenticate server files through CA files
Openssl x509-req-days 3650-in server.csr-CA ca.crt-CAkey ca.key-CAcreateserial-out server.crt
Dh file generation
Openssl dHParam-outform PEM-out dh2024.pem 1024
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.