Passphrases and default encoding

33 views
Skip to first unread message

Themis

unread,
Oct 28, 2018, 4:26:38 AM10/28/18
to python-gnupg
Hi,

I ran into a problem, the default encoding is `latin-1`, every passphrase gets encoded with it.
This fails if the passphrase contains any non latin-1 chars.

So we can set the encoding to `utf-8`, but i wonder why is it not the default? Neither in gnupg itself nor in python-gnupg?

What problems will i possibly run into if i set it to `utf-8`?

We ship on Windows and Linux if that matters

thanks for your help

regards
Themis

Vinay Sajip

unread,
Oct 28, 2018, 4:39:26 AM10/28/18
to python-gnupg
Dear Themis,

It's not the default because it's not a default specified by gpg. In fact gpg doesn't seem to have a very good story regarding encodings - there are numerous issues which have been raised, with differing resolutions. It's a bit of a free-for-all - for example, a keyring can have a bunch of username data for different keys encoded with different encodings.

Setting the encoding on the GPG instance to utf-8 could lead to other problems. You could try passing an already-encoded passphrase.

Regards,

Vinay Sajip
Reply all
Reply to author
Forward
0 new messages