I need to probe if a given String matches a scrypt key.
Some examples that need to match:
$s0$e0801$epIxT/h6HbbwHaehFnh/bw==$7H0vsXlY8UxxyW/BWx/9GuY7jEvGjT71GFd6O4SZND0=
$s0$100808$6McCjsQBpcCShLWq4nl3gg==$gs+Tz5DLGCDtYHGpIkP4i3EDpufBzsEGvoXzegkO5cU=
I use Javas String.matches
function.
The description of the Keys is like this: Basic form: $s0$params$salt$key
The values stand for:
This is the best I could come up with. Any better answer is greatly appreciated.
Java:
String match = "^\\$s0\\$[0-9a-f]{5,6}\\$[a-zA-Z0-9/+]+[=]*\\$[a-zA-Z0-9/+]+[=]*$"
General:
^\$s0\$[0-9a-f]{5,6}\$[a-zA-Z0-9/+]+[=]*\$[a-zA-Z0-9/+]+[=]*$
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.