GPGME question about ciphertext and plaintext sizes

Werner Koch wk at
Wed May 10 12:59:07 CEST 2023

On Tue,  9 May 2023 17:48, Dim Xr said:

> same size? Is there any way to have FPE (Format Preserving Encryption) via

No.  GPGME uses the OpenPGP and S/MIME protocols (gpg and gpgsm) and is
not suitable for your task.  You need to use a low level crypto library
for that (e.g. Libgcrypt) and decide which algorithm, mode and
additional information you use.  For example it is possible to create an
IV or nonce from the block number but there are many security pitfalls.
You may want to read some papers about crypto file systems and look at
implementations for Linux and *BSD.

In GnuPG we have a disk encryption tools (g13) but that takes only care
of encrypting the actual symmetric encryption key.  Everything else is
left to dmcrypt.



The pioneers of a warless world are the youth that
refuse military service.             - A. Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: openpgp-digital-signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <>

More information about the Gnupg-users mailing list