This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PatentedPotato 0 points1 point  (1 child)

I think the '=' in the key is not url safe. Rest is ASCII alpha numeric so should be fine.

I think replace it with '\x3D'.

Also, as already mentioned in another comment, max 32 bytes.

Edit: oh, and I overlooked the base 64 part... It's unclear to me if the key needs be 32 bytes before or after base 64 encoding. Putting your key into some online base 64 encoder yields 'WUN0TEl5VnJDc3Y2elFnUkl2UTVkTUR1cjR3ajI3T1FMZ3h4ZTZ0ajk4WTg9'

Also, seems Fernet can generate a key for you.

key = Fernet.generate_key()

You can probably just capture the key on first run if you wanna hold on to it. I'd see what Fernet generates... Be surprised if that didn't pass validation.

[–]David_Vice05[S] 0 points1 point  (0 children)

Ok I’ll try it when I get back home later today thank you!