This shows you the differences between two versions of the page.
pm:prj2022:apredescu:111 [2022/05/10 12:08] dinu_stefan.rusu [Results] |
pm:prj2022:apredescu:111 [2022/06/24 10:38] (current) dinu_stefan.rusu [Download] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Infrared lock ====== | + | ====== Password manager ====== |
+ | ===== Rusu Dinu-Ștefan 1221EA ===== | ||
===== Introduction ===== | ===== Introduction ===== | ||
- | A lock based on a set of signals received from the remote, the user can set multiple "passwords" in the form of button presses on the remote. The user can also wipe old "passwords", and the statusses will be displayed on the LCD, also the lock status will be displayed on the same LCD (locked/unlocked/no password). This is intended to be used like a password manager, to save highly sensitive passwords that you don t want on a computer such as banking pins, card pins, etc | + | A password manager (similar to a physical crypto wallet), that can be interacted with using a remote. The user can save multiple passwords by using the menus of the wallet. On the LCD are displayed the saved passwords and the status. Passwords can be added, deleted and saved to the EEPROM. It is intended to be used with highly sensitive passwords such as banking passwords (card pins, etc) that should never touch the internet. |
===== General description ===== | ===== General description ===== | ||
- | {{:pm:prj2022:ea:dinu_stefan_rusu:ma_diagram_hardware_rusu_dinu_stefan.png?800|}} | + | {{:pm:prj2022:ea:dinu_stefan_rusu:ma_diagram_hardware_rusu_dinu_stefan.png?600|}} |
- | {{:pm:prj2022:ea:dinu_stefan_rusu:ma_diagram_rusu_dinu_stefan.png?800|}} | + | {{:pm:prj2022:ea:dinu_stefan_rusu:ma_diagram_rusu_dinu_stefan.png?600|}} |
===== Hardware Design ===== | ===== Hardware Design ===== | ||
Line 12: | Line 13: | ||
Parts list: Arduino UNO R3, Infrared receiver, remote control, Alphanumeric LCD, breadboard, resistor 1k, jumper wires | Parts list: Arduino UNO R3, Infrared receiver, remote control, Alphanumeric LCD, breadboard, resistor 1k, jumper wires | ||
+ | {{:pm:prj2022:ea:dinu_stefan_rusu:rusu_dinu_stefan_electric_schematic_visual.png?600|}} | ||
+ | |||
+ | {{:pm:prj2022:ea:dinu_stefan_rusu:rusu_dinu_stefan_electric_schematic_wireframe.png?600|}} | ||
===== Software Design ===== | ===== Software Design ===== | ||
+ | Developed using CLion (+PlatformIO) and Arduino IDE (to upload the code to the Arduino). On boot, the wallet displays a seed, that is used in the companion app to retrieve the password. After the password is entered in the wallet, the user can scroll trough the passwords, edit or delete a password or save a new one. After performing edits on the passwords, they can be saved by pressing FOL+ while in ADD_PASSWORD mode (mode 4). This is done in order to prevent too many writes to the EEPROM (after 100000 writes, the EEPROM will become damaged, hence an 'autosave' feature is not provided). | ||
- | Firmware: | + | Modularity and reusability were key while writing the code for the wallet, in order to allow for ease of expansion, and addition of new features. |
- | * developed using: CLion (+PlatformIO) and Arduino IDE (C++) | + | |
- | * the user can register a new password, if he correctly guessed the 'master password' | + | In order to easily debug the code and to trim'spammy' logs in the case that not all of them are necessary, 3 logging levels exist (No logs, warning, warning & info), and 2 type of logs (Info & Warning). Logging is handled by: |
- | * the user can wipe all passwords, but not the 'master password' | + | <code>void printDebugInfoMessage(const String &message)</code> |
- | * the user can lock and unlock the device | + | and |
- | * all passwords are saved in EEPROM | + | <code>void printDebugWarningMessage(const String &message)</code> |
- | * companion cross-platform Mobile app (similar to 2 Factor), used to get the 'master password' from the seed (Dart & Flutter) | + | |
+ | In order to define the logging level, debuggingLevelEnabled from currentState must be changed to one of: NO_LOGS, WARNINGS, INFO. | ||
+ | |||
+ | To decode the signal from the remote, the <code>String decodeRemoteCode(uint32_t code)</code> function is used, that contains a switch that returns the letter that was pressed. I did not use a HashMap in order to save memory. | ||
+ | |||
+ | Each remote code is written as a define at the top of the program, in order to easily update the code in case that a different remote is used. Also, all other constants such as pins, the password cover, and the logging levels are defined in the same way. | ||
+ | |||
+ | The wallet has a custom built state management system, in order to not refresh the display every time loop() is ran. The state of the wallet is kept in a struct, and if any field in that struct is changed, a state changed is triggered, and the display is refreshed. The state is handled by: | ||
+ | <code>void setState(int32_t state, int32_t debuggingEnabled, const String &display, const String &displayRow2, const String &input = currentState.input, const String &password = currentState.password, const String &secrets = currentState.secrets)</code> | ||
+ | |||
+ | In order to write to the display, a custom function is used, that handles a few write modes, such as appending text and overwriting, and also the line on which the text is going to be written to. Writing to the display is handled by: | ||
+ | <code>void writeToDisplay(const String &word, bool append = true, bool firstRow = true, bool appendSpace = true)</code> | ||
+ | |||
+ | The companion app is a cross-platform app, written in Flutter (a framework for building cross-platform apps developed by Google, on top of Dart) that allows the user to get the wallet password and view quick tutorials about each mode of the wallet. | ||
===== Results ===== | ===== Results ===== | ||
The device works as expected, passwords are saved and retrieved from EEPROM, there seem to be no bugs in the software, neither for the Arduino nor for the companion app. | The device works as expected, passwords are saved and retrieved from EEPROM, there seem to be no bugs in the software, neither for the Arduino nor for the companion app. | ||
+ | |||
+ | {{:pm:prj2022:ea:dinu_stefan_rusu:rusu_dinu_stefan_10_.jpg?600|}} | ||
+ | |||
+ | {{:pm:prj2022:ea:dinu_stefan_rusu:rusu_dinu_stefan.jpg?600|}} | ||
+ | |||
+ | {{:pm:prj2022:ea:dinu_stefan_rusu:rusu_dinu_stefan_2_.jpg?600|}} | ||
+ | |||
+ | |||
+ | |||
+ | {{:pm:prj2022:ea:dinu_stefan_rusu:rusu_dinu_stefan_3_.jpg?200|}} | ||
+ | {{:pm:prj2022:ea:dinu_stefan_rusu:rusu_dinu_stefan_5_.jpg?200|}} | ||
+ | {{:pm:prj2022:ea:dinu_stefan_rusu:rusu_dinu_stefan_6_.jpg?200|}} | ||
+ | |||
+ | {{:pm:prj2022:ea:dinu_stefan_rusu:rusu_dinu_stefan_7_.jpg?200|}} | ||
+ | {{:pm:prj2022:ea:dinu_stefan_rusu:rusu_dinu_stefan_8_.jpg?200|}} | ||
+ | {{:pm:prj2022:ea:dinu_stefan_rusu:rusu_dinu_stefan_9_.jpg?200|}} | ||
===== Conclusions ===== | ===== Conclusions ===== | ||
This was the first project of this type that I've made, it helped me better understand the labs, and how hardware works. | This was the first project of this type that I've made, it helped me better understand the labs, and how hardware works. | ||
===== Download ===== | ===== Download ===== | ||
- | You can find the code for the Arduino [[https://github.com/xrusu/ma-lab|here]] https://github.com/xrusu/ma-lab and for the companion app [[https://github.com/xrusu/ma-lab-companion|here]] https://github.com/xrusu/ma-lab-companion. | + | You can find the code for the Arduino [[https://github.com/xrusu/arduino-password-manager|here]] https://github.com/xrusu/arduino-password-manager and for the companion app [[https://github.com/xrusu/arduino-password-manager-companion|here]] https://github.com/xrusu/arduino-password-manager-companion, or you can download the archives from here: |
- | <note warning> | + | {{:pm:prj2022:ea:dinu_stefan_rusu:rusu_dinu_stefan_1221a_arduino_code.zip|Wallet code archive}} |
- | O arhivă (sau mai multe dacă este cazul) cu fişierele obţinute în urma realizării proiectului: surse, scheme, etc. Un fişier README, un ChangeLog, un script de compilare şi copiere automată pe uC crează întotdeauna o impresie bună ;-). | + | |
+ | {{:pm:prj2022:ea:dinu_stefan_rusu:rusu_dinu_stefan_1221a_companion_code.zip|Companion code archive}} | ||
- | Fişierele se încarcă pe wiki folosind facilitatea **Add Images or other files**. Namespace-ul în care se încarcă fişierele este de tipul **:pm:prj20??:c?** sau **:pm:prj20??:c?:nume_student** (dacă este cazul). **Exemplu:** Dumitru Alin, 331CC -> **:pm:prj2009:cc:dumitru_alin**. | ||
- | </note> | ||
===== Log ===== | ===== Log ===== | ||
- | 21/04/2022: Project selection | + | 20/05/2022: Added more details about 'Software' on wiki |
- | 22/04/2022: Wiki page | + | 09/05/2022: Wiki brush-up |
- | + | ||
- | 07/05/2022: Started writing the software | + | |
08/05/2022: Code brush-up | 08/05/2022: Code brush-up | ||
- | 09/05/2022: Wiki brush-up | + | 07/05/2022: Started writing the software |
+ | 22/04/2022: Wiki page | ||
+ | |||
+ | 21/04/2022: Project selection | ||
===== Bibliography/Resources ===== | ===== Bibliography/Resources ===== | ||
Line 54: | Line 88: | ||
[[https://www.vishay.com/docs/82491/tsop382.pdf | IR Receiver Datasheet]] | [[https://www.vishay.com/docs/82491/tsop382.pdf | IR Receiver Datasheet]] | ||
+ | |||
+ | [[https://dart.dev/ | Dart]] | ||
+ | |||
+ | [[https://docs.flutter.dev/ | Flutter]] | ||
<html><a class="media mediafile mf_pdf" href="?do=export_pdf">Export to PDF</a></html> | <html><a class="media mediafile mf_pdf" href="?do=export_pdf">Export to PDF</a></html> | ||