The DecryptFile method will decrypt the
contents of a file previously encrypted with the EncryptFile
method and stores the decrypted data in the specified output file.
The password (or passphrase) provided by the caller is used to generate
a SHA-256 hash value which is used as part of the decryption process.
Due to how the SHA-256 hash is generated, this method cannot be
used to decrypt files that were encrypted using another third-party
library. It can only be used to decrypt data that was previously
encrypted using EncryptFile.
A temporary file is created during the decryption process and the
output file is created or overwritten only if the input file could be
successfully decrypted. If the decryption fails, no output file will
be created.
This method uses the Microsoft CryptoAPI and the RSA AES
cryptographic provider. This provider may not be available in some
languages, countries or regions. The availability of this provider may
also be constrained by cryptography export restrictions imposed by the
United States or other countries. If the required cryptographic
provider is not available, the method will fail.