jasg
jasg

Reputation: 182

Using botan argon2 command line tools

I'm trying to use argon2 for password hashing from within a C++ application. The Botan library seems well regarded for this. I have installed the library on my system via yum.

I'm trying to use the command line utilities provided to test the library. Using the following command:

botan gen_argon2 mypass

I get output like this:

$argon2id$v=19$m=65536,t=1,p=1$Wr2U4EazXMyIS3RJJczZ9Q$TE4xgLdvtLVNgia9wyrXpI+KSFkw6YJo2RR0yQVeahM

I then want to verify this

botan check_argon2 mypass $argon2id$v=19$m=65536,t=1,p=1$Wr2U4EazXMyIS3RJJczZ9Q$TE4xgLdvtLVNgia9wyrXpI+KSFkw6YJo2RR0yQVeahM

I get Password is NOT valid

What am I doing wrong?

I've tried putting various parts of the output of gen_argon2 as the input to check_argon2 but always get NOT valid.

I've tried an online hash generator checker here: https://argon2.online This verifies the full hash $argon2id$v=19$m=65536,t=1,p=1$dNxyyHX/WSojvaSwAEilwg$I9F/yzzMk/fclJIFNrkoSjP1WxVOI0lZJU1FTWRmxu0 as being correct I've tried putting the hash in quotes to avoid bash interpreting any of it, but still no joy.

Update: Calling the corresponding functions from C++ seems to work as expected, so maybe this is just a command line parsing issue.

I have more questions on the botan library but I'll post those separately

Upvotes: 0

Views: 617

Answers (1)

Royce Williams
Royce Williams

Reputation: 1639

It looks like your shell may be escaping the $ characters. Try wrapping your hash in single quotes on the command line.

Upvotes: 2

Related Questions