Skip to content

BM-Ghost/keylock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

16 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

KeyLock

Professional Offline Cryptographic & HSM Simulation Platform

Version Platform Kotlin Compose License

πŸ” Overview

KeyLock is a comprehensive cryptographic calculator and Hardware Security Module (HSM) command simulator designed for:

  • Payments Engineers
  • Cryptography Specialists
  • Security Professionals
  • HSM Operators
  • Payment Card Industry (PCI) Teams

Key Features

βœ… 100% Offline Operation - No cloud, no telemetry, no analytics
βœ… Comprehensive Crypto Tools - AES, DES, RSA, ECC, hashing, MAC
βœ… HSM Simulation - Thales, Atalla, SafeNet command sets
βœ… Payments Focused - CVV, PIN, MAC, DUKPT, EMV operations
βœ… Secure by Design - Encrypted storage, memory zeroization, auto-lock
βœ… Professional UI - Dark green theme, expert-focused workflow

🎯 Core Modules

1. Crypto Calculator

Complete cryptographic operations suite with 7 main categories:

  • Main - AES/DES encryption, modes (ECB, CBC, CFB, OFB), KCV
  • Generic - Hashes, encoding, BCD, Base64, UUID
  • Cipher - AES, DES, RSA, ECC, ECDSA, FPE
  • Keys - Key generation, HSM keys, key blocks (Thales, TR-31)
  • Payments - CVV, MAC, PIN, DUKPT, card validation
  • EMV - Cryptograms, SDA, DDA, secure messaging, ATR/APDU parsing
  • Development - Padding, trace parsing, bit operations

2. HSM Commander

Offline HSM command simulation engine supporting:

  • Thales - 100+ commands (NO, A0, A6, CA, BK, etc.)
  • Atalla - Core PIN, key, and MAC commands
  • SafeNet - Encryption and key management commands

Features:

  • Command console with history
  • Structured request/response parsing
  • Encrypted audit logging
  • Load testing capability

3. Security Layer

  • Master password authentication
  • Auto-lock on inactivity
  • AES-256-GCM encrypted storage
  • Secure memory zeroization
  • Future: Biometric authentication

πŸ› οΈ Technology Stack

Component Technology
Language Kotlin 2.0.21
UI Framework Jetpack Compose
Architecture MVVM + Clean Architecture
Cryptography Java Cryptography Architecture (JCA)
Platform Android (iOS/Desktop planned)
Build Gradle with Kotlin DSL

πŸ“± Screenshots

Coming soon: Screenshots of Crypto Calculator, HSM Commander, and Console output

πŸš€ Getting Started

Prerequisites

  • Android Studio Ladybug or later
  • JDK 21
  • Android SDK 26+ (minimum)
  • Android SDK 36 (target)

Build Instructions

  1. Clone the repository:
git clone https://github.com/yourusername/keylock.git
cd keylock
  1. Open in Android Studio

  2. Sync Gradle dependencies

  3. Build and run:

./gradlew assembleDebug

Or use Android Studio's Run button.

Configuration

No configuration needed - the app is 100% offline and requires no API keys or external services.

πŸ“– Usage

Quick Start: AES Encryption

  1. Launch KeyLock
  2. Enter master password (minimum 8 characters)
  3. Navigate to Crypto Calculator
  4. Select algorithm: AES-256, mode: CBC
  5. Input:
    • Key (64 hex characters)
    • Data (hex or ASCII)
    • IV (32 hex characters)
  6. Click ENCRYPT
  7. View result in console

HSM Command Example

  1. Navigate to HSM Commander
  2. Select Thales vendor
  3. Enter command: NO00 (diagnostics)
  4. Click EXECUTE
  5. View response: NP00SIM-KEYLOCK-001

πŸ“š Documentation

See KEYLOCK_PRO_DOCUMENTATION.md for:

  • Complete feature documentation
  • Architecture details
  • API reference
  • Security considerations
  • Implementation roadmap

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           UI Layer (Compose)            β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚   Crypto   β”‚   HSM    β”‚  Security  β”‚ β”‚
β”‚  β”‚ Calculator β”‚Commander β”‚   Vault    β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚         Domain Layer (Business Logic)   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚  β”‚   Crypto   β”‚   HSM    β”‚  Security  β”‚ β”‚
β”‚  β”‚   Engine   β”‚  Engine  β”‚   Manager  β”‚ β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚          Data Layer (Storage)           β”‚
β”‚        Encrypted SharedPreferences      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”’ Security

Implemented

βœ… Master password authentication
βœ… Encrypted local storage (AES-256-GCM)
βœ… Memory zeroization for sensitive data
βœ… No network connectivity
βœ… Auto-lock on inactivity

Planned

⏳ Biometric authentication (fingerprint, face)
⏳ Hardware device binding
⏳ Tamper detection
⏳ Screen capture prevention

οΏ½ CI/CD Pipeline

Automated Build Workflow:

Build KeyLock - Builds APK artifacts

  • Triggers: Push to dev/qa/main
  • Creates: APK files for installation
  • Artifacts: keylock-{branch}-{timestamp}-apk

APK Downloads:

Branch Artifact Name Build Type Retention
dev keylock-dev-{timestamp}-apk Debug APK 30 days
qa keylock-qa-{timestamp}-apk Release APK 30 days
main keylock-main-{timestamp}-release Signed APK + AAB 90 days

Timestamp format: ddmmyyyyhhmmss (e.g., 24022026143000)

Getting the APK:

  1. Go to GitHub β†’ Actions tab
  2. Click Build KeyLock workflow (not Code Quality)
  3. Scroll to Artifacts section
  4. Download the timestamped APK

Workflow:

  1. Develop on dev branch (automatic debug builds)
  2. Merge to qa for QA team testing (automatic release builds)
  3. Merge to main for production (automatic signing & Play Store artifacts)

Version Number: Each build gets a unique version based on build time (ddmmyyyyhhmmss)

οΏ½πŸ—ΊοΈ Roadmap

Version 1.1 (Q2 2026)

  • Complete Payment menu tools (CVV, DUKPT, PIN)
  • Complete EMV menu tools (cryptograms, SDA/DDA)
  • Full RSA implementation
  • Settings screen

Version 1.2 (Q3 2026)

  • Compose Multiplatform (Desktop support)
  • Biometric authentication
  • Import/export encrypted backups

Version 2.0 (Q4 2026)

  • Real HSM integration
  • Smartcard reader support
  • Advanced scripting

πŸ“„ License

Proprietary - All Rights Reserved

This is professional software for cryptography and payments engineers.

🀝 Contributing

This is a proprietary project. For collaboration inquiries, please contact the maintainer.

⚠️ Disclaimer

This software is for professional use only. It provides cryptographic operations for:

  • Development and testing
  • HSM simulation and training
  • Cryptographic validation
  • Payment system integration testing

Not intended for:

  • Production payment processing
  • Real financial transactions
  • Replacement for certified HSM hardware

Always use certified, audited cryptographic solutions for production systems.

πŸ“§ Support

For professional support and inquiries:


KeyLock - Professional Cryptographic Tools for Payments Engineers

100% Offline β€’ Zero Telemetry β€’ Secure Local Storage

About

KeyLock is a secure Android app for generating, managing, and exporting DUKPT and MKSK cryptographic keys. It enforces PCI PIN security, hardware-backed protection, and tamper-evident audit controls.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages