A realistic OTP (One-Time Password) validation simulator with phone number verification, countdown timers, and transaction processing animations - built purely in Bash.
A secure, real-time simulation of bank-grade authentication 🔒:

Watch the test suite in action📋:

- TRAI-compliant validation: Ensures Indian numbers start with
6/7/8/9. - Hidden OTP input: Uses
-sflag to prevent shoulder-surfing. - Fraud detection: 20-second lockout after invalid attempts.
- Visual countdown timer: Real-time updates with color coding.
- Animated processing: Simulates bank transaction flows.
- Dynamic terminal output: Clean text overwriting (
\r).
- Adjustable OTP expiry time (
time_setvariable). - Color customization via ANSI codes.
- Terminals: Bash-compatible (Linux/macOS/WSL/Git Bash) .
- Editor: VS Code (optional but recommended) .
# Clone repository (if applicable)
git clone https://github.com/nevinbeno/Secure-OTP-Transaction.git
cd Secure-OTP-Transaction
# Make executable and run
chmod +x secure_otp_transaction.bash
./secure_otp_transaction.bash-
Save as :
secure_otp_transaction.bash. -
Open integrated terminal
-
Execute with Bash :
bash secure_otp_transaction.bash| Component | Technology Used |
|---|---|
| Phone Validation | Regex ^[6-9][0-9]{9}$ |
| Background Timer | Subshells () & |
| Process Termination | kill -9 $$ signal |
| UI/UX | ANSI color codes, \r |
bash <(curl -s https://raw.githubusercontent.com/nevinbeno/Secure-OTP-Transaction/main/secure_otp_transaction.bash)Enterprise - grade testing for all authentication components.
#Run all tests (from project root)
bash run_tests.bash