README.md 3.35 KB
Newer Older
Pedro Cavaleiro committed
1
# Introduction 
Pedro Cavaleiro committed
2
This project is a prototype of a encrypted recycle bin.
Pedro Cavaleiro committed
3

Pedro Cavaleiro committed
4
All files are encrypted with an random pin and they're also signed digitally.
Pedro Cavaleiro committed
5

Pedro Cavaleiro committed
6
The pin must not be outputed to the user nor saved anywere on the computer.
Pedro Cavaleiro committed
7 8 9

The user, to recover the file, has 3 attempts to guess the pin of the file, if it fails to guess the pin the file gets deleted.

10
The software also checks for errors on the encrypted file upon the decryption process
Pedro Cavaleiro committed
11

Pedro Cavaleiro committed
12 13
# Available Cyphers
So far there is only one cypher implemented, AES-CBC
Pedro Cavaleiro committed
14

Pedro Cavaleiro committed
15
# Available HASH
16
So far there is only on hash algorithm, SHA256 being used to generate the secure key and to create a hash for the encrypted file
Pedro Cavaleiro committed
17 18 19

# Commands available
restorefile
Pedro Cavaleiro committed
20

Pedro Cavaleiro committed
21
validatefile
Pedro Cavaleiro committed
22

Pedro Cavaleiro committed
23
setcypher
Pedro Cavaleiro committed
24

Pedro Cavaleiro committed
25
sethash
Pedro Cavaleiro committed
26

Pedro Cavaleiro committed
27
setenabled
Pedro Cavaleiro committed
28

Pedro Cavaleiro committed
29
showconfig
Pedro Cavaleiro committed
30

Pedro Cavaleiro committed
31
help
Pedro Cavaleiro committed
32

Pedro Cavaleiro committed
33 34
exit

Pedro Cavaleiro committed
35

Pedro Cavaleiro committed
36 37
# Restore a file
restorefile [options]
Pedro Cavaleiro committed
38

Pedro Cavaleiro committed
39
-l               lists the encrypted files
Pedro Cavaleiro committed
40

Pedro Cavaleiro committed
41
-p <pin> <file>  tries to decrypt the file using the given pin
Pedro Cavaleiro committed
42

Pedro Cavaleiro committed
43 44
This command can only contain one of the options

Pedro Cavaleiro committed
45

Pedro Cavaleiro committed
46 47
# Validate a file
validatefile [file]
Pedro Cavaleiro committed
48

Pedro Cavaleiro committed
49
The file can be an absolute path or if the file it's in the restored folder there's only the need to type the file name
Pedro Cavaleiro committed
50

Pedro Cavaleiro committed
51 52 53 54
The Signature (.sig) and Public Key (.pk) must be in the same directory of the file being checked

# Settings
setchypher [cypher] [keysize]
Pedro Cavaleiro committed
55

Pedro Cavaleiro committed
56
The keysize for now it's allways 16 as there is a problem with java that gives allways Ilegal Key Size even when the sizes are 24 or 32 (valid key sizes for AES-CBC)
Pedro Cavaleiro committed
57

Pedro Cavaleiro committed
58

Pedro Cavaleiro committed
59
sethash [hash]
Pedro Cavaleiro committed
60

61
Sets the hash algorithm that will be used to generate the hash of the encrypted file
Pedro Cavaleiro committed
62

Pedro Cavaleiro committed
63

Pedro Cavaleiro committed
64
setenabled [boolean]
Pedro Cavaleiro committed
65

Pedro Cavaleiro committed
66 67
Setting this setting to true or false will enable or disable the encryption process

Pedro Cavaleiro committed
68

Pedro Cavaleiro committed
69 70
# Other Commands
help
Pedro Cavaleiro committed
71

Pedro Cavaleiro committed
72 73
This show in app help menu explaining all the commands

Pedro Cavaleiro committed
74

Pedro Cavaleiro committed
75
exit
Pedro Cavaleiro committed
76

Pedro Cavaleiro committed
77 78
Terminates the program and all it's threads

Pedro Cavaleiro committed
79 80
# Build and Test
To build and test, open the project using IntelliJ IDEA, Netbeans or other Java IDE and run the program
Pedro Cavaleiro committed
81

Pedro Cavaleiro committed
82 83
# How does it work
On the first start the program will create a config.cfg file to save the settings and will create 3 folders Fall_Into_Oblivion, Trashed, Restored.
Pedro Cavaleiro committed
84

Pedro Cavaleiro committed
85
The folders Trashed and restored will be inside the Fall_Into_Oblivion folder
Pedro Cavaleiro committed
86

Pedro Cavaleiro committed
87
Once these folders are created and the software is running you can move the files into the root of the folder "Fall_Into_Oblivion" and not the "Trashed" folder, the software will then sign and encrypt, with a random four digit pin unknown to the user, the file and will create a hash of the encrypted file.
Pedro Cavaleiro committed
88

Pedro Cavaleiro committed
89
The unencrypted file is now deleted and inside the trashed folder you have another folder with the file name and extension, inside that folder there should be four files. filename.ext.aescbc filename.ext.sig filename.ext.pk filename.ext.aescbc.hash
Pedro Cavaleiro committed
90

Pedro Cavaleiro committed
91 92 93 94 95 96 97 98 99 100
These files contain the encrypted file, the signature, the public key and the hash of the encrypted file

Upon decryption the software first check the integrity of the encrypted file if it's ok it tries tries to decrypt the file.

If the pin is incorrect the software will search for the files .filename.ext.lock, .lock.sig and lock.pk if none of these files are not found the software will create them.

The file filename.ext.lock contains the hash of the attempt and filename

After three attempts the file is deleted

Pedro Cavaleiro committed
101 102 103 104 105 106 107 108 109 110 111 112 113
If there is only one file missing lock.sig, lock.pk or .filename.ext.lock the system deletes the file

# Developers

André Ricardo

Miguel Brandões

Pedro Cavaleiro

Raúl Barbosa

Ricardo Cardoso