Skip to content

securityeasy

Base64url Without the Padding

100 points · 0 solved

JWTs and many tokens use base64url: - and _ instead of + and /, and the = padding removed. The first line is T; each next line is a token. Print the decoded UTF-8 text, or INVALID if the token has any character outside A-Z a-z 0-9 - _, has a length where length % 4 == 1, or doesn't decode to valid UTF-8. An empty line decodes to an empty line.

2
aGVsbG8gd29ybGQ
not*valid
hello world
INVALID
Learn the technique/learn/secure-coding-in-practice

main.py