Encrypt a password for use with this library.
Cifrar una contraseƱa para su uso con este producto.
| Cmd : | ENCRYPTPWD Command |
| .NET : | Sat.EncryptPwd Method |
| VBA/VB6 : | satEncryptPwd Function |
| C (ANSI) : | SAT_EncryptPwd Function |
| C++ (STL) : | firmasat::Sat::EncryptPwd |
The EncryptPwd function creates an encrypted form of a password. This
can be used anywhere in the FirmaSAT product in place of a normal
password in the szPassword parameter. This reduces the
risks in storing the actual password for your private key in the clear in your code
or on your server.
The encrypted password can be saved in a text file and the file path name to that file can be passed to the function instead of the encrypted password itself.
Note that the encrypted password value will be different each time it is created. Different outputs for the same password are all valid.
The maximum password text that can be encrypted is 62 characters. The encrypted password is always exactly 135 characters long and consists of capital letters and numbers beginning with 5L. The contents of the encrypted file must be exactly 135 characters long with no whitespace or line endings.
The password is encrypted using the AES-128 Key Wrap Algorithm specified in RFC3394.
NOTE: This feature avoids the dangers of keeping a raw password in the clear, but be aware there is a risk that a determined hacker with access to your system could recover the password.
FIRMASAT ENCRYPTPWD -p <password>
FIRMASAT ENCRYPTPWD -p <password> -o <outfile>
(Line breaks added for clarity)
> FirmaSAT ENCRYPTPWD -p 12345678a
5L7DGNWK76P2XLWY7SMY6YIYS2LZ7KKEYYQALQ5H2WURW5KOQYKX4CVAZMH5NPDPRILV
FQA4TMIBAJBG6YSCM4334JNAASTIWOFTP4VFF5VYYWBSMIKER62P444LZCKV556GUZI
> FirmaSAT SIGNXML -k emisor.key -c emisor.cer -i cfdv40-min.xml -o cfdv40-min-signed.xml
-p 5L7DGNWK76P2XLWY7SMY6YIYS2LZ7KKEYYQALQ5H2WURW5KOQYKX4CVAZMH5NPDPRILV
FQA4TMIBAJBG6YSCM4334JNAASTIWOFTP4VFF5VYYWBSMIKER62P444LZCKV556GUZI
> FirmaSAT VERIFYSIG cfdv40-min-signed.xml
OK
Using a file instead of the encrypted password
> FirmaSAT ENCRYPTPWD -p 12345678a -o myencryptedpassword.txt
> FirmaSAT SIGNXML -k emisor.key -c emisor.cer -i cfdv40-min.xml -o cfdv40-min-signed.xml
-p myencryptedpassword.txt