EvotecIT / PSPGP

PSPGP is a PowerShell module that provides PGP functionality in PowerShell. It allows encrypting and decrypting files/folders and strings using PGP.
MIT License
57 stars 21 forks source link

PSPGP HashAlgorithmTag "SHA256" #15

Closed deonschan closed 10 months ago

deonschan commented 1 year ago

Hi Przemysław Kłys, thanks so much for this great ps for pgp. Have a question of how to change HashAlgorithmTag? As read PgpCore, the default of HashAlgorithmTag is SHA1. I want to change it using SHA256. Any parameter of your ps or other way that can achieve it? Thanks.

PrzemyslawKlys commented 1 year ago

This is currently not supported. WE would need to expand Protect-PGP and once it connects $PGP = [PgpCore.PGP]::new($EncryptionKeys) we need to allow people to change those values

image

image

image

It doesn't seem like a hard thing to do. Feel free to submit PR or I'll fix it at some point

PrzemyslawKlys commented 10 months ago
Protect-PGP -FilePathPublic $PSScriptRoot\Keys\PublicPGP.asc -String "This is string to encrypt" -HashAlgorithm Sha256 -CompressionAlgorithm Zip

I've exposed different parameters and it should be possible to use it now