private static void keyCreation() {

		boolean kc_loop = true;	// makes sure key creation loops
		do {
			System.out.println("\n\n\n+==+ KEY CREATION +==+ \n\n"+
							"-- 1 - Create public & private keys -- \n"+
							"-- 2 - Change prime numbers' bit length (current: "+length+" bits) -- \n"+
							"-- 3 - Go back --");
			// take input
			layer_2 = user_input.next();
			
			switch(layer_2) {		
			// Key creation
				case "1":
					KeyGen.keyCreation(length);
					
					System.out.println("\nPublic & Private keys have been created and saved.");
					break;
			// Key bit length
				case "2":
					boolean kbl_loop;	// loops until valid input is given
					
					System.out.println("Enter required bit length: ");
					do{
						try {
							length = Integer.parseInt(user_input.next());
							kbl_loop = false;
						}
						catch(Exception excptn) {
							System.out.println("Error: not an integer!\n"+
												"Try again: ");
							kbl_loop = true;
						}
					}while(kbl_loop);
					
					System.out.println("Primes' bit length changed to "+length+".");
					break;
				
			// Quit
				case "3":
					kc_loop = false;
					break;
				default:
					System.out.println("Invalid input.");
					break;
			}
		}while(kc_loop);
	}