API Definitions
API Definition for PassPhraseEncryption Method
The PassPhraseEncryption
method is static and can be used directly using the PassPhraseSecure
class. In the PassPhraseEncryption
method, you can pass the following parameters:
Option - Text/File
String - Text/File to be encrypted
For error messages, refer String Related Input-Error Messages Table.
Note
It is recommended to use only obfuscated passwords.
Example (using CADP.NetCore.Utility)
PassPhraseSecure.PassPhraseEncryption(PassPhraseSecure.Options.Text,”textToEncrypt”)
OR
PassPhraseSecure.PassPhraseEncryption(PassPhraseSecure.Options.File,”fileToEncrypt”)
The PassPhraseSecure
method allows the user to give inputs for String
in the following ways:
Text - The length of the text to be obfuscated must be <1024 characters, excluding leading and trailing whitespaces. Any leading and trailing whitespaces are removed from the text before obfuscation.
File - Only first line from the file is obfuscated irrespective of the file length.
String Related Input-Error Messages
Input | Error Message |
---|---|
No input text (Blank) | Error: Please check the value passed in the parameter. The value is empty. |
Text length equals to or greater than 1024 characters | Error: Passphrase is too long. Please enter text of length less than 1024. |
File with incorrect file name | Error: Please check the file path. Could not open file. |
Blank file | Error: Please check the data in the file to encrypt. |