@@ -21,7 +21,7 @@ Generates Time-based One-Time Password's (TOTP) using MicroPython, Raspberry Pi
21
21
- Create a ` WifiSecrets.json ` file (based on ` WifiSecrets.json.example ` ) which includes the common wifi SSIDs + passphrases available.
22
22
- Flash the Pico W with the latest [ MicroPython] ( https://micropython.org/download/rp2-pico-w/ ) .
23
23
- Copy the codebase except ` main.py ` to the Raspberry Pi Pico W.
24
- - Open an interactive session on the Pico and encrypt the codes.json and WifiSecrets.json as below:
24
+ - Open an interactive session on the Pico and encrypt the ` codes.json ` and ` WifiSecrets.json ` as below:
25
25
```
26
26
>>> import cryptor
27
27
>>> cryptor.encrypt('codes.json','mypasswd')
@@ -32,8 +32,28 @@ Generates Time-based One-Time Password's (TOTP) using MicroPython, Raspberry Pi
32
32
- Reset the Pico W
33
33
- Enter your password at the initial password prompt.
34
34
- Fix datetime at prompt if Wifi doesn't work.
35
- - Now you can cycle through your TOTP's using a button.
35
+ - Now you can cycle through your TOTP's using Key0 of the Pico-Oled-1.3.
36
+ - Key1 of the Pico-Oled-1.3 toggles the display ON/OFF.
36
37
38
+ # Updating secrets
39
+
40
+ - Connect to the REPL
41
+ - Press CTRL-C to stop the code and bring up the prompt
42
+ - Run the following code to dump the secrets files to console as plain text:
43
+ ```
44
+ >>> import cryptor
45
+ >>> print(cryptor.decrypt('codes.json.encoded','mypasswd').decode())
46
+ >>> print(cryptor.decrypt('WifiSecrets.json.encoded','mypasswd').decode())
47
+ ```
48
+ - Copy the outputs into ` codes.json ` and ` WifiSecrets.json ` on your workstation, and update with new secrets as required.
49
+ - Push the updated ` codes.json ` and ` WifiSecrets.json ` to the Pico W.
50
+ - Encrypt ` codes.json ` and ` WifiSecrets.json ` and overwrite previous encoded files as below:
51
+ ```
52
+ >>> import cryptor
53
+ >>> cryptor.encrypt('codes.json','mypasswd')
54
+ >>> cryptor.encrypt('WifiSecrets.json','mypasswd')
55
+ ```
56
+ - Remove the unencrypted ` WifiSecrets.json ` and ` codes.json ` from the Pico W storage.
37
57
38
58
Notes:
39
59
1 . The Bootsel button is used for user input as the pico-oled-1.3 only has 2 buttons
0 commit comments