Securing Passphrase
Securing Passphrase
A passphrase can be secured in the following three ways:
Obfuscated Passphrase
To obfuscate the passphrase and store the obfuscated value in the Passphrase
parameter:
Enable the passphrase obfuscation (i.e. set Passphrase_Encrypted=yes).
Run the command line utility (PassPhraseSecure) from the command line, as shown below:
The parameters with PassPhraseSecure utility allows the user to provide different inputs to the utility. The parameters used are:
PassPhraseSecure -txt
<TextToBeObfuscated>
: This parameter allows the user to provide input as text and display the obfuscated value.Note
If the text to (be obfuscated) contains whitespaces then it must be provided within double quotes (" ").
For example:
Note
The length of the text to be obfuscated must be <=1023 characters, excluding leading and trailing whitespaces. Any leading and trailing whitespaces are removed from the text before obfuscation.
PassPhraseSecure -file
<FileName>
: This parameter allows the user to provide input from a file and display the obfuscated value. The FileName could be the name and path of the file from which the text is to be obfuscated. For example:Note
There exists no restriction on length of the file. However, only first line from the file is obfuscated irrespective of the file length.
PassPhraseSecure -help: This parameter displays the help, to use this utility, on the console. For example:
If user does not provide any parameter with the utility, the same -help parameter output is displayed.
Secured Passphrase
You can use the I_C_SetPassPhraseCallback() function to secure the passphrase. This function can be used to get the passphrase using a user-specified callback function.
The I_C_SetPassPhraseCallback() function can only be used when Passphrase_Encrypted=no
. When the I_C_SetPassPhraseCallback() function is called, it sets the callback function to get the passphrase. In this case, the plaintext passphrase stored in the Passphrase
parameter is ignored.
For Example: The following is an example of using secured passphrase functionality:
This causes the password to be dynamically collected when reading Key_File
while establishing SSL connection with the server. Here, getstring is the user-specified function that provides the user with a customized approach to secure/get the passphrase.
Plaintext Passphrase
When Passphrase_Encrypted
is set to no, and the callback function is not used, the Passphrase parameter
stores the password in plaintext for the private key. Storing the password in plaintext on the system is against a good security practice, as it might compromise the security of the private key.
Note
It is strongly recommended to use secured or obfuscated passphrase.