-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
59 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,40 @@ | ||
#include <Cape.h> | ||
|
||
Cape cape("YOUR-ENCRYPTION-KEY", 2); | ||
Cape cape("SECRET-KEY", 10); | ||
// Insert your secret key and its length | ||
|
||
void setup() { | ||
Serial.begin(115200); | ||
} | ||
|
||
void loop() { | ||
unsigned long time = micros(); | ||
cape.encrypt("Hello world!", 12); | ||
cape.encrypt("Original data!", 14); | ||
time = micros() - time; | ||
|
||
Serial.println("------------------"); | ||
Serial.print("CRIPTED: "); | ||
for(int i = 0; i < 12; i++) | ||
for(int i = 0; i < 14; i++) | ||
Serial.print(cape.result[i]); | ||
|
||
Serial.print(" Masked IV: "); | ||
Serial.print((uint8_t)cape.result[14], DEC); | ||
Serial.print(" Computation time: "); | ||
Serial.print(time); | ||
Serial.println(" microseconds"); | ||
|
||
time = micros(); | ||
cape.decrypt(cape.result, 12); | ||
cape.decrypt(cape.result, 15); | ||
// Result String is 1 character longer because of the initialization vector | ||
time = micros() - time; | ||
|
||
Serial.print("ORIGINAL: "); | ||
for(int i = 0; i < 12; i++) | ||
for(int i = 0; i < 14; i++) | ||
Serial.print(cape.result[i]); | ||
|
||
Serial.print(" Real IV: "); | ||
Serial.print((uint8_t)cape.result[14], DEC); | ||
Serial.print(" Computation time: "); | ||
Serial.print(time); | ||
Serial.println(" microseconds"); | ||
|
||
delay(150); | ||
delay(500); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
name=Cape | ||
version=1.0 | ||
version=1.2 | ||
author=Giovanni Blu Mitolo <gioscarab@gmail.com> | ||
maintainer=Giovanni Blu Mitolo <gioscarab@gmail.com> | ||
sentence=Cape is a string encpryption library | ||
paragraph=Provides private key, an iteration tunable stream chipher algorithm with the addition of 1 byte initialization vector. | ||
paragraph=Provides private key, stream chipher with masked initialization vector. | ||
category=Data Processing | ||
url=https://github.com/gioblu/Cape | ||
architectures=avr |