Fund. C Prog.辅导、讲解Databases、讲解Java/CS程序、辅导Python/C/C++
- 首页 >> Python编程Fund. C Prog. Assessment task 3: Group 16
Project - Checkpoint 1
UCrypt - USB Crypto tool
(48430-2018-SPRING-CITY)
Matthew Delotavo Changhui He Shihao Li
Wei Ting Tuan Tianqi Zhang
September 21, 2018
Contents
1 Objective 2
2 Scope 2
3 Program Features 3
3.1 InitDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.2 Users . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.3 RSA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.3.1 Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.4 Database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.4.1 Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.4.2 Credentials . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.4.3 Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3.5 Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4 Structure Chart 5
5 References 5
1
1 Objective
UCrypt is a USB file vault; inspired by KeePass1 and Pass2
. It let’s users define
their own RSA-inspired crypto scheme for their UCrypt database as well as
external files.
2 Scope
1. Autodetect and access USB storage devices with a UCrypt database
2. RSA for encryption and decryption
3. Encrypt data before saving to disk
4. Store decrypted entries in RAM as linked list nodes
5. Search and filter decrypted entries
6. A single UCrypt database can accomodate multiple users
(a) users are asked to authenticate their username and private key to
decrypt their data
i. a test string encrypted with the user’s public key will be decrypted
to verify a user has entered a valid private key
(b) users can add, edit and delete encrypted credentials
(c) users can encrypt files with another user’s public key to send them a
secret message
7. Users can encrypt and decrypt their database and external files using the
default scheme or define their own
8. Provides interactive and non-interactive (via command-line arguments)
modes
1https://keepass.info
2https://www.passwordstore.org
2
3 Program Features
3.1 InitDB
Initialize a UCrypt hidden database on a specified USB storage device.
3.2 Users
Users have the following:
1. username
2. password (private key)
3. public key
4. UCryptDB (database)
3.3 RSA
UCrypt uses a simple implementation of the RSA3
cryptosystem as follows:
1. Use
(me)d ≡ m (mod n)
where e, d and n are tunable parameters (default paramaters will be provided)
2. encrypt message m with a user’s public key e via
c ≡ me
(mod n)
3. decrypt ciphertext c above via
cd ≡ (me)d ≡ m (mod n)
where d is the user’s private key
Users can also define a custom number of passes of the RSA cryptosystem over
their data in addition to tuning the default parameters.
3.3.1 Example
If public key is n = 3233, e = 17 and private key is n = 3233, d = 413, then
encryption function is:
c(m) = m17 mod 3233
and decryption function is:
m(c) = c
413 mod 3233
3https://en.wikipedia.org/wiki/RSA_(cryptosystem)
3
3.4 Database
3.4.1 Tree
.ucryptdb/
.alice.pubkey
.bob.pubkey
.anon.pubkey
users
credentials/
alice.crd
bob.crd
anon.crd
messages/
alice.msg
bob.msg
anon.msg
3.4.2 Credentials
TBD
3.4.3 Messages
TBD
3.5 Search
TBD
4
4 Structure Chart
UCrypt
ucrypt.c
help()
menu()
initdb()
findusb()
openusb()
newfile()
savefile()
encrypt()
loadfile()
decrypt()
editfile()
displaydata()
searchdata()
createuser()
usermod()
showdetails()
editdetails()
deleteuser()
keygen()
createnewcrypto()
resetcrypto()
showuserfiles()
authenticateuser()
isvalidpass()
ucrypt.h
prototypes
RSA definitions
makefile
5 References
https://keepass.info
https://www.passwordstore.org
https://en.wikipedia.org/wiki/RSA_(cryptosystem)