can decrypt database correctly. now with tests