all repos — dpwm @ f6b555f938049e1b6d8fc4e2a18c3e86d48c7ffe

A minimal and secure password manager in D.

better performance on old hardware
Marco Andronaco andronacomarco@gmail.com
Thu, 31 Oct 2019 21:15:52 +0100
commit

f6b555f938049e1b6d8fc4e2a18c3e86d48c7ffe

parent

530daad54fced0d6ca2d6f79c60571d76d7d0885

1 files changed, 6 insertions(+), 3 deletions(-)

jump to
M source/app.dsource/app.d

@@ -2,6 +2,7 @@ import std.stdio;

import std.file; import std.utf : byChar; import std.string; +import secured.hash; import secured.symmetric; import std.json; import std.digest.md;

@@ -28,15 +29,17 @@ }

void encryptDB(string pw, string content, string filename){ - //write default data structure on DB - std.file.write(filename, cast(string) encrypt(string2MD5(pw), cast(ubyte[]) content, null)); + //ubyte[] data = encrypt(string2MD5(pw), cast(ubyte[]) content, null); + ubyte[] data = encrypt_ex(string2MD5(pw), cast(ubyte[]) content, null, defaultChunkSize, SymmetricAlgorithm.ChaCha20_Poly1305, KdfAlgorithm.PBKDF2, defaultKdfIterations, defaultSCryptR, defaultSCryptP, HashAlgorithm.SHA2_512); + + std.file.write(filename, cast(string) data); } void main(){ const string inputFile = "data.db"; //welcome text - writeln("Welcome to my pw manager tool.\n"); + writeln("Welcome to dpwm.\n"); string temp; JSONValue db;