Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tharushaudana/esp-program-protector
Prevent unauthorized copying and reflashing of your ESP program. Secure, simple, and effective.
https://github.com/tharushaudana/esp-program-protector
arduino bin-protection code-protection esp32 esp8266 guard prevent-copy security
Last synced: 2 months ago
JSON representation
Prevent unauthorized copying and reflashing of your ESP program. Secure, simple, and effective.
- Host: GitHub
- URL: https://github.com/tharushaudana/esp-program-protector
- Owner: tharushaudana
- Created: 2024-06-28T08:34:10.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-06-28T08:52:16.000Z (6 months ago)
- Last Synced: 2024-09-29T22:45:57.730Z (3 months ago)
- Topics: arduino, bin-protection, code-protection, esp32, esp8266, guard, prevent-copy, security
- Language: C++
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ESP Program Security Guard
A simple but powerful method to prevent copying the program binary file from ESP devices and reflashing it to another ESP device.
## How to Use
1. **Clone the Repository**
```sh
git clone https://github.com/tharushaudana/esp-program-protector.git
cd esp-program-protector
```2. **Upload `key_flasher` Code**
Upload the `key_flasher` code to your ESP device. This will generate a unique key for the device (using the chip ID and flash chip ID) and write it to EEPROM.
3. **Add `security_barier()` to Your Program**
In your program code, add `security_barier()` at the beginning of the `void setup()` function. Then, upload your program code. See `program/program.ino` for an example.
```cpp
void setup() {
security_barier();
// Your setup code here
}
```## How It Works
1. **Key Generation**
When you upload the `key_flasher` code, it generates a unique key for the device using the chip ID and flash chip ID. This key is then written to EEPROM.
2. **Key Validation**
In your program code, `security_barier()` reads the stored key from EEPROM and compares it with the device's actual key. If the key is valid, the program continues to run. If the key is not valid (or not written), the program will not continue.
## Custom Key Generation
You can use your own unique key generation method or algorithm to generate your own key type. Simply modify the `gen_security_key()` in the `security.h` files.
## Conclusion
We hope this simple method helps you secure your program from being copied and flashed onto unauthorized ESP devices.
---
Feel free to contribute to this project or report any issues you encounter. Your feedback is valuable in improving the security and functionality of this guard method.