Skip to content

lewisxy/epd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EPD - Encrypted Password Database

EPD is a tool to archive personal credentials (mostly passwords) and store them safely in file. It is designed to be secure, lightweighted, portable, and convenient.

Supported platform: Windows (Mingw/MSVC), *nix (tested on Linux)

NOTE AND UPDATE: This software is still under development. Minor changes may be applied to the file structures and functionalities. Backward capability is not garuenteed.

WARNING: This tool is not approved by any authorities on data security or cryptography. The author of this software is not an expert in security related fields. Please be informed that any use of this software is at users own risk and the author is not responsible for any property or data losses.

Installation

EPD provides no installation by itself as it emphasizes portability. The below instruction covers only the building process. The resulted binary will be in build directory.

Windows

There is two ways to build on Windows. If you can either build with Mingw or MSVC. Building with Mingw requires the installation of Mingw-w64. Building with MSVC requires the installation of Visual Studio Build Tool. This tool is installed automatically if you have installed any version of Visual Studio. If you don't want to install Visual Studio, please see this one.

Mingw

Open a command prompt with all necessary environmental variables set (for example, put the Mingw installation path in path variable), redirect to the project directory, and use the below command.

$ make -f Makefile.mingw epd

MSVC

Open the Visual Studio Build Tool command prompt, see this, redirect to the project directory and use the below command.

$ nmake -f Makefile.win epd

Linux (and Unix, untested)

Open the terminal and redirect to the project directory. Use below command.

$ make -f Makefile.nix epd

Usage

The brief documentation is located in doc.h, which will be printed out if you run the binary with -h. Full documentation is not yet finished.

Data Structure

EPD will create two kinds of file, the key file and the database file. The key file is generated by keygen command and is required for all the database operation (feed in by -k option). The database file will ends with .edb and contains the data.

Key file

[Public Key (32)][Secret key* (64)][Signature (64)]

*The secret key is 32 bytes long by itself, and there are some addtional information (iv, protective hash). The total length is 64 bytes.

Database file

The database structure is slightly complicated.

[IV (8)][Ephermeral Public Key (32)][ENC 1][Checksum 1 (32)][ENC 2][Checksum 2 (32)]

IV is 8 bytes, Keys are 32 bytes, Checksums are 32 bytes.

ENC 1 is the block of header, index, and tags.

ENC 2 is the block of data.

Although the Checksum 1 is inserted in the middle, the encryption runs through ENC 1 and ENC 2. This is an important security measure against Reuse key/iv attack.

ENC 1

Suppose there are totally n entries, and m tags (the maximum is 64)

[Header (84)][n Table entries (n * 80)][Tag (8)][m Tags (m * 64)]
Header
[Program name (10)][Program Version (6)][DB name (64)][nentry (4)]

nentry is the number of entries in the database

Table
[HTAG (8)][Tag (8)][Entry Name (16)][Encryption Key/Ephermeral Public Key (32)][Public key Fingerprint (16)]
Tags

The first part of tags are 8 bytes, which is 64 bits, each representing the availability of the that tag. If there are m tags available, there should be m 1s in this section.

The second part of tags are m 64 bytes block placed in order, which contains the tag name, a char * type C-style string, the maximum character length is 63 (termination byte is always needed).

ENC 2

[n Data entryies (n * 528)]
[HTAG (8)][Tag (8)][Full name (128)][Note (256)][Value (128)]

The data contains the same HTAG entry and Tag entry with the corresponding entry in table. The Full name of each entry is 128 bytes, and the name stored in table is the first 16 bytes of these 128 bytes.

Data entries (not including HTAG) are encrypted seperately using the key in table entry (even in memory). The value encapsulated in the data entry is encrypted seperately as well.

NOTE

  1. Though the author has limited expertise in developing this kind of software, the security model should work and may be redudent. This may affect the performance of this software. It is normal for it to take several seconds to complete one operation (without compiler optimization).

  2. There may be some minor issues/bugs of this software, since there is not enough tests to prove its robostness. It is welcome to test this program and provide issues/bug reports and suggestions for further improvements.

TODOs

The below items are unordered

  1. Better customization support in config.h
  2. Unfinished features (add/delete tags, change data entry, change key password)
  3. Better looking UI (not GUI)
  4. Interactive Design (with mini terminal built-in)
  5. Bug fix (currently not yet Valgrind free)
  6. Better documentation
  7. ...

Special thanks

This program is largely inspired by skeeto/enchive, which provides the data securitycmodel for this program. The ed.c is a amalgamation of kc1212/ref10_extract, which provides the functionality of ed25519 signature using Curve25519 key pairs.

About

Encrypted Password Database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages