Hashing is used in digital signatures. By default DidiSoft OpenPGP Library for .NET uses SHA1.
To set another hashing algorithm to be used for signing data, you have to change the default with the property Hash of a PGPLib class instance.
The possible values are listed in the DidiSoft.Pgp.HashAlgorithm enumeration:
HashAlgorithm.SHA1 HashAlgorithm.SHA256 HashAlgorithm.SHA384 HashAlgorithm.SHA512 HashAlgorithm.SHA224 HashAlgorithm.MD5 HashAlgorithm.MD2 HashAlgorithm.RIPEMD160
This example shows how to set the digital signature hashing algorithm to SHA-256:
PGPLib pgp = new PGPLib(); pgp.Hash = HashAlgorithm.SHA256;
Dim pgp As New PGPLib() pgp.Hash = HashAlgorithm.SHA256
This chapter discussed changing the hash function used in OpenPGP signatures created with the PGPLib class.
You may also be interested in how to change the default cipher and default compression algorithms.