Version v0.3.32 - Update readme.md some more
This commit is contained in:
137
README.md
137
README.md
@@ -1,48 +1,5 @@
|
|||||||
# OTP Cipher - One Time Pad Implementation
|
# OTP Cipher - One Time Pad Implementation
|
||||||
|
|
||||||
## Quick Start
|
|
||||||
|
|
||||||
### Download Pre-Built Binaries
|
|
||||||
|
|
||||||
**[📥 Download Latest Release](https://git.laantungir.net/laantungir/otp/releases)**
|
|
||||||
|
|
||||||
Visit the releases page and download the appropriate binary for your system:
|
|
||||||
- `otp-vX.X.X-linux-x86_64` for Intel/AMD 64-bit systems
|
|
||||||
- `otp-vX.X.X-linux-arm64` for Raspberry Pi and ARM 64-bit systems
|
|
||||||
|
|
||||||
After downloading:
|
|
||||||
```bash
|
|
||||||
# Make executable and run
|
|
||||||
chmod +x otp-v*-linux-x86_64
|
|
||||||
./otp-v*-linux-x86_64
|
|
||||||
```
|
|
||||||
|
|
||||||
**Or use the local build:**
|
|
||||||
```bash
|
|
||||||
# After building from source
|
|
||||||
./build/otp-x86_64 # x86_64 systems
|
|
||||||
./build/otp-arm64 # ARM64 systems
|
|
||||||
```
|
|
||||||
|
|
||||||
### First Steps
|
|
||||||
|
|
||||||
1. **Generate your first pad:**
|
|
||||||
```bash
|
|
||||||
./build/otp-x86_64 generate 1GB
|
|
||||||
```
|
|
||||||
|
|
||||||
2. **Encrypt a message:**
|
|
||||||
```bash
|
|
||||||
./build/otp-x86_64 encrypt
|
|
||||||
# Follow the interactive prompts
|
|
||||||
```
|
|
||||||
|
|
||||||
3. **Decrypt a message:**
|
|
||||||
```bash
|
|
||||||
./build/otp-x86_64 decrypt
|
|
||||||
# Paste the encrypted message
|
|
||||||
```
|
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
A secure one-time pad (OTP) cipher implementation in C.
|
A secure one-time pad (OTP) cipher implementation in C.
|
||||||
@@ -83,8 +40,6 @@ To address this problem, we can use Nostr to share among devices the place in th
|
|||||||
One-time pads can be trivially encrypted and decrypted using pencil and paper, making them accessible even without electronic devices.
|
One-time pads can be trivially encrypted and decrypted using pencil and paper, making them accessible even without electronic devices.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- **Perfect Security**: Implements true one-time pad encryption with information-theoretic security
|
- **Perfect Security**: Implements true one-time pad encryption with information-theoretic security
|
||||||
@@ -99,73 +54,95 @@ One-time pads can be trivially encrypted and decrypted using pencil and paper, m
|
|||||||
- **Cross-Platform**: Works on Linux and other UNIX-like systems
|
- **Cross-Platform**: Works on Linux and other UNIX-like systems
|
||||||
|
|
||||||
|
|
||||||
## Building
|
## Quick Start
|
||||||
|
|
||||||
|
### Download Pre-Built Binaries
|
||||||
|
|
||||||
|
**[Download Current Linux x86](https://git.laantungir.net/laantungir/otp/releases/download/v0.3.31/otp-v0.3.31-linux-x86_64)**
|
||||||
|
|
||||||
|
**[Download Current Raspberry Pi 64](https://git.laantungir.net/laantungir/otp/releases/download/v0.3.31/otp-v0.3.31-linux-arm64)**
|
||||||
|
|
||||||
|
After downloading:
|
||||||
|
```bash
|
||||||
|
# Make executable and run
|
||||||
|
chmod +x otp-v0.3.31-linux-x86_64
|
||||||
|
./otp-v0.3.31-linux-x86_64
|
||||||
|
```
|
||||||
|
|
||||||
|
### First Steps
|
||||||
|
|
||||||
|
1. **Generate your first pad:**
|
||||||
|
```bash
|
||||||
|
./otp-v0.3.31-linux-x86_64 generate 1GB
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **Encrypt a message:**
|
||||||
|
```bash
|
||||||
|
./otp-v0.3.31-linux-x86_64 encrypt
|
||||||
|
# Follow the interactive prompts
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Decrypt a message:**
|
||||||
|
```bash
|
||||||
|
./otp-v0.3.31-linux-x86_64 decrypt
|
||||||
|
# Paste the encrypted message
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Building from Source
|
||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
- GCC compiler
|
- GCC compiler
|
||||||
- Git (for version tracking)
|
|
||||||
- Make
|
- Make
|
||||||
- Optional: ARM64 cross-compiler (`gcc-aarch64-linux-gnu`) for cross-compilation
|
|
||||||
|
|
||||||
### Build Commands
|
### Build Commands
|
||||||
|
|
||||||
Use the included build script for automatic versioning and cross-compilation:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Build for current architecture (with auto-versioning)
|
|
||||||
./build.sh "commit message"
|
|
||||||
|
|
||||||
# Build commands
|
|
||||||
./build.sh build "commit message" # Build x86_64 and ARM64 (if cross-compiler available)
|
|
||||||
./build.sh clean # Clean build artifacts
|
|
||||||
./build.sh install # Install to system
|
|
||||||
./build.sh uninstall # Remove from system
|
|
||||||
```
|
|
||||||
|
|
||||||
The build script automatically:
|
|
||||||
- Increments patch version (v0.3.24 → v0.3.25)
|
|
||||||
- Creates git commit and tag
|
|
||||||
- Builds for x86_64 and ARM64 (if cross-compiler available)
|
|
||||||
- Outputs to `build/otp-x86_64` and `build/otp-arm64`
|
|
||||||
- Uploads binaries to Gitea releases (if `~/.gitea_token` exists)
|
|
||||||
|
|
||||||
### Traditional Make
|
|
||||||
|
|
||||||
You can also use make directly (without automatic versioning):
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
make # Build for current architecture
|
make # Build for current architecture
|
||||||
make static # Static linking
|
make static # Static linking (standalone binary)
|
||||||
make clean # Clean artifacts
|
make clean # Clean build artifacts
|
||||||
make install # Install to /usr/local/bin/otp
|
make install # Install to /usr/local/bin/otp
|
||||||
make uninstall # Remove from system
|
make uninstall # Remove from system
|
||||||
```
|
```
|
||||||
|
|
||||||
Output: `build/otp-$(ARCH)` (e.g., `build/otp-x86_64`)
|
Output: `build/otp-$(ARCH)` (e.g., `build/otp-x86_64`)
|
||||||
|
|
||||||
|
After building, run with:
|
||||||
|
```bash
|
||||||
|
./build/otp-x86_64
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
### Interactive Mode
|
### Interactive Mode
|
||||||
```bash
|
```bash
|
||||||
|
# If you downloaded the binary:
|
||||||
|
./otp-v0.3.31-linux-x86_64
|
||||||
|
|
||||||
|
# If you built from source:
|
||||||
./build/otp-x86_64
|
./build/otp-x86_64
|
||||||
# or
|
|
||||||
./build/otp-arm64 # On ARM systems
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Command Line Mode
|
### Command Line Mode
|
||||||
```bash
|
```bash
|
||||||
# Generate a new pad
|
# Generate a new pad
|
||||||
./build/otp-x86_64 generate 1GB
|
./otp-v0.3.31-linux-x86_64 generate 1GB
|
||||||
|
|
||||||
# Encrypt text (interactive input)
|
# Encrypt text (interactive input)
|
||||||
./build/otp-x86_64 encrypt <pad_hash_or_prefix>
|
./otp-v0.3.31-linux-x86_64 encrypt <pad_hash_or_prefix>
|
||||||
|
|
||||||
# Decrypt message (interactive input)
|
# Decrypt message (interactive input)
|
||||||
./build/otp-x86_64 decrypt <pad_hash_or_prefix>
|
./otp-v0.3.31-linux-x86_64 decrypt <pad_hash_or_prefix>
|
||||||
|
|
||||||
# List available pads
|
# List available pads
|
||||||
./build/otp-x86_64 list
|
./otp-v0.3.31-linux-x86_64 list
|
||||||
```
|
```
|
||||||
|
|
||||||
## Version System
|
## Version System
|
||||||
|
|||||||
36
build.sh
36
build.sh
@@ -155,6 +155,42 @@ update_source_version() {
|
|||||||
else
|
else
|
||||||
print_warning "src/main.h not found - skipping version update"
|
print_warning "src/main.h not found - skipping version update"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Update README.md with direct download links
|
||||||
|
if [ -f "README.md" ]; then
|
||||||
|
print_status "Updating README.md with download links for $NEW_VERSION..."
|
||||||
|
|
||||||
|
# Create the new download section with direct download links
|
||||||
|
local NEW_DOWNLOAD_SECTION="### Download Pre-Built Binaries
|
||||||
|
|
||||||
|
**[Download Current Linux x86](https://git.laantungir.net/laantungir/otp/releases/download/${NEW_VERSION}/otp-${NEW_VERSION}-linux-x86_64)**
|
||||||
|
|
||||||
|
**[Download Current Raspberry Pi 64](https://git.laantungir.net/laantungir/otp/releases/download/${NEW_VERSION}/otp-${NEW_VERSION}-linux-arm64)**
|
||||||
|
|
||||||
|
After downloading:
|
||||||
|
\`\`\`bash
|
||||||
|
# Make executable and run
|
||||||
|
chmod +x otp-${NEW_VERSION}-linux-x86_64
|
||||||
|
./otp-${NEW_VERSION}-linux-x86_64
|
||||||
|
\`\`\`"
|
||||||
|
|
||||||
|
# Use awk to replace the section between "### Download Pre-Built Binaries" and "### First Steps"
|
||||||
|
awk -v new_section="$NEW_DOWNLOAD_SECTION" '
|
||||||
|
/^### Download Pre-Built Binaries/ {
|
||||||
|
print new_section
|
||||||
|
skip=1
|
||||||
|
next
|
||||||
|
}
|
||||||
|
/^### First Steps/ {
|
||||||
|
skip=0
|
||||||
|
}
|
||||||
|
!skip
|
||||||
|
' README.md > README.md.tmp && mv README.md.tmp README.md
|
||||||
|
|
||||||
|
print_success "Updated README.md with download links for $NEW_VERSION"
|
||||||
|
else
|
||||||
|
print_warning "README.md not found - skipping README update"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Cross-platform build functions
|
# Cross-platform build functions
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
// Version - Updated automatically by build.sh
|
// Version - Updated automatically by build.sh
|
||||||
#define OTP_VERSION "v0.3.30"
|
#define OTP_VERSION "v0.3.31"
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
#define MAX_INPUT_SIZE 4096
|
#define MAX_INPUT_SIZE 4096
|
||||||
|
|||||||
Reference in New Issue
Block a user