I'm working on PGP symmetric key (passphrase), below options should be used to encrypt the file,
- Symmetric-Key Algorithm should be 9 (AES-256)
- compression Algorithm should be 0 (Uncompressed)
- Hash Algorithm should be 8 (SHA-256)
- Passphrase: Server Secret concatenated with a random 256-bit Client Secret
- S2k-count: 65535
- Filename: Any non-null value (typically the FileId + PartNumber)
- Mode: b (62)
I want to encrypt the file using the above options. I tried this, and it's working but somehow it's not creating the correct encrypted file.
I'm using a third-party integration, that has asked me to encrypt the file using the above options, when I try to decrypt the file at their end it fails. So that's how I know there is something wrong with the options.
gpg --passphrase 'Test' --s2k-digest-algo SHA256 --cipher-algo AES256 --compress-algo 0 --s2k-count 65535 -e -r "Test" sample.csv
Is this correct? Can anyone tell me the correct options?
Test
as passphrase? If you don't have more information, I would suggest you contact them to figure out where it goes wrong. Why not ask them how they encrypt, and that they provide a test set?gpg -e -r recipientid
does publickey (hybrid) encryption;gpg -c [--passphrase password [--batch | --pinentry-mode=loopback]]
does password-based 'symmetric' encryption of the data (not the passphrase). Read the man page. Note the passphrase must be human-typable, so (something described as) a '256-bit client secret' probably doesn't work.