ServerKM3init.js and ClientKM3.js 4 Sep. 2016
These files incorporate the Kryptomessage protocol into two different PICOs each connected to an ESP8266 using the PICO shim.
The Squirt utility was used to write the cryptographic keys into the EPROM on each PICO. See previous posts for modules and squirt.js
To run these programs you will need to “Squirt” the keys into the PICOs.
Edit ServerKM3init.js with your router information:
var SSID="router SSID";
var key= "router key";
Load Server KM3init.js into the first PICO and enter “save();” into the left screen.
It should save the program so that at power up the program will run. It usually goes on to connect to the router. Note the server IP address. With a browser you can pull the server up by using http://192.168.1.4:8080/ where 192.168.1.4 is the IP address. Your server IP address may be different
With the second client PICO pull up ClientKM3.js and edit the following with your local information.
ServerIP="192.168.1.4";
//setup WiFi access parameters
var RouterSSID="router SSID";
var Routerkey= "routerkey";
Load and run ClientKM3.js.
At this point, I disconnect from the client PICO and reconnect with the Server PICO using WebIDE. I use Putty (or another terminal program, to connect to the Client PICO at 155,200 baud.
The Client Screen using Putty
8
do LEDoff
Client user message
Permutated Encrypted Message=
e6,f8,af,13,54,7e,b7,e9,3b,c0,7e,95,2b,6b,14,4c,
15,24,41,37,ae,36,76,18,d2,bc,31,ae,3d,62,74,9a,
ed,e1,3d,f,7d,1,10,c6,ea,66,b,de,bc,27,72,6c,
e1,cf,2a,b4,2f,1a,b7,e,4a,ef,a6,43,30,cf,9,d0,
57,3b,9a,c7,e9,3a,e6,10,2a,83,ef,9b,a5,6a,d8,db,
80
192.168.1.4
send
Closed: 80
process client
decrypt
Client checks the server message
Client check of server msg OK
Client checks if the server is authentic
Server is Authentic
Client sees msg 0x43
Select using digit and return key
1 Connect 6 Cshow
2 Logoff 7 LEDon
3 Creplay 8 LEDoff
4 Creset 9 Read ADC
5 n/a 0 Exit { "free": 2311, "usage": 2789, "total": 5100, "history": 2021,
"stackEndAddress": 536959420, "flash_start": 134217728, "flash_binary_end": 376280, "flash_code_start": 134234112, "flash_length": 393216 }
>
The Server Screen:
decrypt
Server checks the client message
Server check of client msg OK
Server checks if the client authentic
Server check of client authenticity OK
Permutated Encrypted Message=
5a,7f,c2,cd,3d,c3,1d,c6,c3,a3,b6,f9,6e,cd,2f,b1,
52,b0,27,b5,ae,8b,5c,29,48,9f,70,a,3d,51,7,3a,
4f,a1,f2,17,7,d1,cf,f5,d5,b6,76,ad,b4,46,d3,db,
7f,d0,b2,c7,8a,48,e7,4f,f9,1d,b2,41,46,b8,23,44,
8e,29,13,33,fd,5b,9b,21,9d,73,3,30,d9,54,e4,e8,
server transmits
Close= false
Post
Post length= 80
doing command
process server
undefined
e6,f8,af,13,54,7e,b7,e9,3b,c0,7e,95,2b,6b,14,4c,
15,24,41,37,ae,36,76,18,d2,bc,31,ae,3d,62,74,9a,
ed,e1,3d,f,7d,1,10,c6,ea,66,b,de,bc,27,72,6c,
e1,cf,2a,b4,2f,1a,b7,e,4a,ef,a6,43,30,cf,9,d0,
57,3b,9a,c7,e9,3a,e6,10,2a,83,ef,9b,a5,6a,d8,db,
decrypt
Server checks the client message
Server check of client msg OK
Server checks if the client authentic
Server check of client authenticity OK
Permutated Encrypted Message=
fb,c3,53,2,49,68,36,87,4a,28,cd,f8,55,b9,bf,79,
16,2d,6b,39,af,ec,d5,ee,b2,2c,d7,77,12,83,88,ed,
50,9c,29,30,2a,c3,3e,2,a7,3,18,f9,7a,48,ef,2a,
5,57,f7,cd,71,c7,17,f1,52,16,4e,17,e6,da,5e,c0,
c8,a5,3b,1f,22,a0,6e,5f,6d,fc,78,25,3a,96,12,57,
server transmits
Close= false
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
ServerKM3init.js and ClientKM3.js 4 Sep. 2016
These files incorporate the Kryptomessage protocol into two different PICOs each connected to an ESP8266 using the PICO shim.
The Squirt utility was used to write the cryptographic keys into the EPROM on each PICO. See previous posts for modules and squirt.js
To run these programs you will need to “Squirt” the keys into the PICOs.
Edit ServerKM3init.js with your router information:
var SSID="router SSID";
var key= "router key";
Load Server KM3init.js into the first PICO and enter “save();” into the left screen.
It should save the program so that at power up the program will run. It usually goes on to connect to the router. Note the server IP address. With a browser you can pull the server up by using http://192.168.1.4:8080/ where 192.168.1.4 is the IP address. Your server IP address may be different
With the second client PICO pull up ClientKM3.js and edit the following with your local information.
ServerIP="192.168.1.4";
//setup WiFi access parameters
var RouterSSID="router SSID";
var Routerkey= "routerkey";
Load and run ClientKM3.js.
At this point, I disconnect from the client PICO and reconnect with the Server PICO using WebIDE. I use Putty (or another terminal program, to connect to the Client PICO at 155,200 baud.
The Client Screen using Putty
The Server Screen:
User ID = "Sam" Password "1234"
2 Attachments