Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

OTP Generator

A Java application that generates a secure 6-digit One-Time Password (OTP) using Java's built-in SecureRandom class.


Features

  • Generates a random 6-digit OTP
  • Uses SecureRandom for cryptographically secure randomness
  • Guarantees exactly six digits
  • Lightweight console application
  • Beginner-friendly Java project

How It Works

The program creates a random number between 100000 and 999999, ensuring every generated OTP contains exactly six digits.

int otp = 100000 + new SecureRandom().nextInt(900000);

Example Output

OTP Generator Output


Run the Project

Compile:

javac OtpGen.java

Run:

java OtpGen

About

A Java application that generates a secure 6-digit One-Time Password (OTP) using Java's SecureRandom class.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages