#!/bin/bash set -euo pipefail # ============================================================================== # Croc Installation Script # ============================================================================== # Installs croc - Secure, fast file transfer tool # # Threat Model: # - Insecure file transfer methods (email, Dropbox, USB drives) # - Cloud storage snooping and data breaches # - Man-in-the-middle attacks during file transfer # - Metadata exposure in file sharing # # How Croc Protects: # - End-to-end encryption using PAKE (Password Authenticated Key Exchange) # - No account or login required # - Direct peer-to-peer transfer (optional relay for NAT traversal) # - Automatic compression # - Resume capability for interrupted transfers # # Source: https://github.com/schollz/croc # ============================================================================== # Colors readonly GREEN='\033[0;32m' readonly YELLOW='\033[1;33m' readonly NC='\033[0m' log() { echo -e "${GREEN}[INFO]${NC} $*"; } warn() { echo -e "${YELLOW}[WARN]${NC} $*"; } echo "=== Croc Installation ===" echo "" log "Downloading and installing croc..." curl https://getcroc.schollz.com | bash echo "" log "Verifying installation..." if command -v croc >/dev/null 2>&1; then log "✅ Croc installed successfully!" croc --version else warn "Croc not found in PATH - may need to add ~/.local/bin to PATH" exit 1 fi echo "" echo "=== Installation Complete ===" echo "" echo "Usage Examples:" echo "" echo " Send a file:" echo " croc send myfile.pdf" echo " # Share the code phrase with recipient" echo "" echo " Receive a file:" echo " croc 1234-code-word-phrase" echo "" echo " Send entire directory:" echo " croc send /path/to/folder" echo "" echo " Custom code phrase:" echo " croc send --code my-secret-phrase file.txt" echo "" echo "📖 Documentation: https://github.com/schollz/croc"