how to use the secret data
Once I have decoded the protobuf message, the secrets look like your example: "\r\037)\335\260l\377\216=\0352O+\352\221.o\177\014e\030\217\352NM~V\322\322 \320\351@\314C"
but that is in bytes format. So how would I convert that to base32 encoded string to use in an otpauth URI?
You could use b32encode from the package base64. Checkout parse.py for an example.
Cool thanks, so I would just have to use a script like:
from base64 import b32encode
print('Encoded string: ', b32encode(b'secret'))
But I wonder if there is a way to do it without python, like just using bash or other command-line utility?
There are probably a lot of other options. You'd have to search for yourself. I wouldn't know
It does seem there is a base32 tool: https://www.man7.org/linux/man-pages/man1/base32.1.html
found something that works finally! printf "%b" 'secret' | base32