Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

import java.util.Random; import java.util.Scanner; class Main { static char[] GeneratePassword(final int len){ System.out.println(Enter: ); final String capital = ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz; final String numbers = 1234567890; final

import java.util.Random; import java.util.Scanner; class Main { static char[] GeneratePassword(final int len){ System.out.println("Enter: "); final String capital = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; final String numbers = "1234567890"; final String specialChars = "!@$%^&*()_=+_[]{}|<>?,.`~;"; final String combinedChars = capital +specialChars + numbers; final Random random = new Random(); final char[] newPass = new char[len]; newPass[0] = numbers.charAt(random.nextInt(numbers.length())); for(int i = 1; i < newPass.length; i++) { newPass[i] = combinedChars.charAt(random.nextInt(combinedChars.length())); } return newPass; } public static void main(final String[] args) { final Scanner input = new Scanner(System.in); final String yes = "y"; System.out.println("do you want a new password?: "); final String pass = input.nextLine(); input.close(); if(yes.equalsIgnoreCase(pass)) { System.out.println(GeneratePassword(10)); } } } can you show how to decrypt this code using caesar cipher method in java please and thank you

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions