From c229aec88e5e51b0373fd15e19136d7fc6ab6aa4 Mon Sep 17 00:00:00 2001 From: Laan Tungir Date: Thu, 18 Dec 2025 10:12:41 -0400 Subject: [PATCH] Version v0.3.32 - Update readme.md some more --- README.md | 137 ++++++++++++++++++++++------------------------------- build.sh | 36 ++++++++++++++ src/main.h | 2 +- 3 files changed, 94 insertions(+), 81 deletions(-) diff --git a/README.md b/README.md index 72671d5..9286c9c 100644 --- a/README.md +++ b/README.md @@ -1,48 +1,5 @@ # 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 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. - - ## Features - **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 -## 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 - GCC compiler -- Git (for version tracking) - Make -- Optional: ARM64 cross-compiler (`gcc-aarch64-linux-gnu`) for cross-compilation ### 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 make # Build for current architecture -make static # Static linking -make clean # Clean artifacts +make static # Static linking (standalone binary) +make clean # Clean build artifacts make install # Install to /usr/local/bin/otp make uninstall # Remove from system ``` Output: `build/otp-$(ARCH)` (e.g., `build/otp-x86_64`) +After building, run with: +```bash +./build/otp-x86_64 +``` + ## Usage ### Interactive Mode ```bash +# If you downloaded the binary: +./otp-v0.3.31-linux-x86_64 + +# If you built from source: ./build/otp-x86_64 -# or -./build/otp-arm64 # On ARM systems ``` ### Command Line Mode ```bash # Generate a new pad -./build/otp-x86_64 generate 1GB +./otp-v0.3.31-linux-x86_64 generate 1GB # Encrypt text (interactive input) -./build/otp-x86_64 encrypt +./otp-v0.3.31-linux-x86_64 encrypt # Decrypt message (interactive input) -./build/otp-x86_64 decrypt +./otp-v0.3.31-linux-x86_64 decrypt # List available pads -./build/otp-x86_64 list +./otp-v0.3.31-linux-x86_64 list ``` ## Version System diff --git a/build.sh b/build.sh index 9c8e3fd..af50bab 100755 --- a/build.sh +++ b/build.sh @@ -155,6 +155,42 @@ update_source_version() { else print_warning "src/main.h not found - skipping version update" 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 diff --git a/src/main.h b/src/main.h index e4818cc..8dc7913 100644 --- a/src/main.h +++ b/src/main.h @@ -23,7 +23,7 @@ #include // Version - Updated automatically by build.sh -#define OTP_VERSION "v0.3.30" +#define OTP_VERSION "v0.3.31" // Constants #define MAX_INPUT_SIZE 4096