Convert hex to base64

First of all, welcome! You can mark your code as code by using three backticks (```) to create a code block. This makes your paste easier to read.

You’ve got encoding and decoding backwards:

julia> str |> hex2bytes |> base64encode
"SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t"

Note that base64encode can also take the UInt8 vector directly.

I’m not aware that something like pycryptodome exists in julia, those that do exist are pre-1.0 and haven’t been updated.

There’s AES.jl for directly using AES, which is probably enough for all cryptopals challenges.

EDIT: :fast_parrot:

3 Likes