There is one common approach which is usually followed to generate a random secret key for a symmetric cipher and then encrypt this key via asymmetric key cryptography. Due to this pattern, the original message itself is encrypted using the symmetric cipher and then using secret key. The receiver after receiving the message decrypts the message. Wanted to also give a small input. I had to implement a very similar function for a project of mine. I can't disclose the algorithm, however. But let me try to give you a couple small hints as to how you could further improve yours. Generating Random Symmetric Keys Problem You want to generate a secure symmetric key. You already have some mechanism for securely transporting the key to anyone who needs it. You - Selection from Secure Programming Cookbook for C and C Book.
Some applications require a symmetric key for encryption and decryption of communications. In this procedure, you create a symmetric key and store it.
If your site has a random number generator, you can use the generator to create a random number for the key. This procedure does not use your site's random number generator.
Use one of the following methods.
The advantage of a file-stored key is that you can extract the key from this file to use in an application's key file, such as the /etc/inet/secret/ipseckeys file or IPsec. The usage statement shows the arguments.
The filename where the key is stored.
For a symmetric key of any length, the value is generic. For a particular algorithm, specify aes, arcfour, des, or 3des.
For FIPS 140-approved algorighms, select a key type that has been validated for FIPS. See FIPS 140 Algorithms in the Cryptographic Framework in Using a FIPS 140 Enabled System in Oracle Solaris 11.2.
The length of the key in bits. The number must be divisible by 8. Do not specify for des or 3des.
For FIPS 140-approved algorithms, select a key length that has been validated for FIPS. See FIPS 140 Algorithms in the Cryptographic Framework in Using a FIPS 140 Enabled System in Oracle Solaris 11.2.
Prints the key to the terminal window. By default, the value of print is n.
The advantage of the PKCS #11 keystore is that you can retrieve the key by its label. This method is useful for keys that encrypt and decrypt files. You must complete Step 1 before using this method. The usage statement shows the arguments. The brackets around the keystore argument indicate that when the keystore argument is not specified, the key is stored in the PKCS #11 keystore.
A user-specified label for the key. The key can be retrieved from the keystore by its label.
For a symmetric key of any length, the value is generic. For a particular algorithm, specify aes, arcfour, des, or 3des.
For FIPS 140-approved algorithms, select a key type that has been validated for FIPS. See FIPS 140 Algorithms in the Cryptographic Framework in Using a FIPS 140 Enabled System in Oracle Solaris 11.2.
The length of the key in bits. The number must be divisible by 8. Do not specify for des or 3des.
For FIPS 140-approved algorithms, select a key length that has been validated for FIPS. See FIPS 140 Algorithms in the Cryptographic Framework in Using a FIPS 140 Enabled System in Oracle Solaris 11.2.
The token name. By default, the token is Sun Software PKCS#11 softtoken.
Specifies the sensitivity of the key. When the value is y, the key cannot be printed by using the print=y argument. By default, the value of sensitive is n.
Specifies that the key can be extracted from the keystore. Specify n to prevent the key from being extracted.
Prints the key to the terminal window. By default, the value of print is n.
You must complete Step 1 before using this method. The usage statement shows the arguments.
A user-specified label for the key. The key can be retrieved from the keystore by its label.
For a symmetric key of any length, the value is generic. For a particular algorithm, specify aes, arcfour, des, or 3des.
For FIPS 140-approved algorithms, select a key type that has been validated for FIPS. See FIPS 140 Algorithms in the Cryptographic Framework in Using a FIPS 140 Enabled System in Oracle Solaris 11.2.
The length of the key in bits. The number must be divisible by 8. Do not specify for des or 3des.
For FIPS 140-approved algorithms, select a key length that has been validated for FIPS. See FIPS 140 Algorithms in the Cryptographic Framework in Using a FIPS 140 Enabled System in Oracle Solaris 11.2.
Artisteer 4.3 activation key generator online. Artisteer 4 License Key Generator 4 0. Artisteer 4 3 Crack Keygen Serial Number - DOWNLOAD 1 / 4. Artisteer 4.3 Keygen is appropriate for running a blog, WordPress Joomla, and lots extra. A good deal rapid and without difficulty make your personal website template via Artisteer 4.3 activation key. Aug 20, 2016 Artisteer 4.3 full free 2017, patcher + licence key Mr. Silent Coder. Unsubscribe from Mr. Silent Coder? Artisteer 4 course - what is artisteer - Duration: 4:48.
The token name. By default, the token is the NSS internal token.
The directory path to the NSS database. By default, directory is the current directory.
The prefix to the NSS database. The default is no prefix.
Use one of the following commands, depending on where you stored the key.
Alternately, replace keystore=pkcs11 with keystore=nss in the command.
In the following example, a user creates a PKCS #11 keystore for the first time and then generates a large symmetric key for an application. Finally, the user verifies that the key is in the keystore.
Note that the initial password for a PKCS #11 keystore is changeme. The initial password for an NSS keystore is an empty password.
Example 3-2 Creating a FIPS-approved AES Key by Using theIn the following example, a secret key for the AES algorithm is created using a FIPS-approved algorithm and key length. The key is stored in a local file for later decryption. The command protects the file with 400 permissions. When the key is created, the print=y option displays the generated key in the terminal window.
The user who owns the keyfile retrieves the key by using the od command.
In the following example, the administrator manually creates the keying material for IPsec SAs and stores them in files. Then, the administrator copies the keys to the /etc/inet/secret/ipseckeys file and destroys the original files.
First, the administrator creates and displays the keys that the IPsec policy requires:
Then, the administrator creates the following /etc/inet/secret/ipseckeys file:
After verifying that the syntax of the ipseckeys file is valid, the administrator destroys the original key files.
The administrator copies the ipseckeys file to the communicating system by using the ssh command or another secure mechanism. On the communicating system, the protections are reversed. The first entry in the ipseckeys file protects inbound packets, and the second entry protects outbound packets. No keys are generated on the communicating system.
Next Steps
To proceed with using the key to create a message authentication code (MAC) for a file, see How to Compute a MAC of a File.