Add argon2id app
This commit is contained in:
parent
f04e802509
commit
727e3c1af4
1 changed files with 22 additions and 2 deletions
24
flake.nix
24
flake.nix
|
|
@ -100,9 +100,29 @@
|
|||
}
|
||||
)
|
||||
self.nixosConfigurations);
|
||||
|
||||
argon2id =
|
||||
let
|
||||
python = pkgs.python3.withPackages (pp: with pp; [
|
||||
argon2-cffi
|
||||
]);
|
||||
in
|
||||
pkgs.writeTextFile {
|
||||
name = "argon2id";
|
||||
text = ''
|
||||
#!${python}/bin/python
|
||||
import getpass
|
||||
from argon2 import PasswordHasher
|
||||
pw = getpass.getpass()
|
||||
ph = PasswordHasher(
|
||||
time_cost=5,
|
||||
memory_cost=2*1024*1024, # in kibibytes
|
||||
parallelism=4,
|
||||
)
|
||||
print(ph.hash(pw))
|
||||
'';
|
||||
executable = true;
|
||||
};
|
||||
});
|
||||
|
||||
}) // {
|
||||
overlay = import ./pkgs;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue