Bug 1250113

Summary: coreutils doesn't include a base32 binary
Product: [Fedora] Fedora Reporter: Nikos Mavrogiannopoulos <nmavrogi>
Component: coreutilsAssignee: Kamil Dudka <kdudka>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: admiller, kdudka, kzak, ovasik, p, twaugh
Target Milestone: ---Keywords: FutureFeature, Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: coreutils-8.25-2.fc24 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-11 16:09:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
base32 program
none
base32 program none

Description Nikos Mavrogiannopoulos 2015-08-04 14:30:06 UTC
Description of problem:
coreutils includes a base64 encoder, but no base32 (or base16). The base32 encoding is very useful for converting OTP keys to a format programs like freeotp accept, and is becoming very popular for URL encoding of data.

All the encodings are described in rfc4648.

Additional info:
Please include a base32 convertor in fedora.

Comment 1 Pádraig Brady 2015-08-04 15:30:53 UTC
Maybe. Please discuss upstream at coreutils though.

See also related discussion at:
http://lists.gnu.org/archive/html/bug-coreutils/2010-04/msg00195.html

Note for URL encoding, base64 is almost perfect and could be tweaked like:

  b64_url_encode() { base64 | tr '+/=' '-_.'; }
  b64_url_decode() { tr -- '-_.' '+/=' | base64 -d; }

Comment 2 Nikos Mavrogiannopoulos 2015-08-04 15:54:16 UTC
I would expect the maintainers of coreutils to talk upstream. I could help if required.

Comment 3 Ondrej Vasik 2015-08-04 20:42:38 UTC
Nikos, for Fedora, it is better if you will discuss this RFE upstream, as you will likely better defend it. And there are many todo tasks... so with patch chances are even higher. Without your proposal upstream and/or patch, I can only put this to the long term todo list.

btw. Pádraig Brady is one of Fedora co-maintainers and upstream (nowadays primary) maintainer.

Comment 4 Nikos Mavrogiannopoulos 2015-08-05 08:46:12 UTC
Created attachment 1059379 [details]
base32 program

This patch adds the base32 program. The need for such a program is because base32 is increasingly used in URLs and QR codes and we have no simple tool to generate such codes. In particular I noticed there were no command line tools to generate otpauth codes as in:
https://github.com/google/google-authenticator/wiki/Key-Uri-Format

Comment 6 Nikos Mavrogiannopoulos 2015-08-05 09:25:58 UTC
Created attachment 1059388 [details]
base32 program

Comment 7 Pádraig Brady 2015-08-05 10:03:47 UTC
Please implement like sha1sum. I.E. reuse base64.c. See src/local.mk for details. Then please post to coreutils. Thanks.

Comment 9 Ondrej Vasik 2015-08-05 13:12:55 UTC
Thanks Pádraig and Nikos!

Comment 10 Pádraig Brady 2015-09-01 15:05:37 UTC
Upstream proposal:
http://lists.gnu.org/archive/html/coreutils/2015-09/msg00000.html

Comment 12 Kamil Dudka 2016-05-11 16:09:29 UTC
This seems to be already fixed since coreutils-8.25-2.fc24.