using the website repl.it (must be done in Javascript)
PGM #1
Write a Java program that can perform the Caesar cipher for English messages that include both upper and lowercase alphabetic characters. The Caesar cipher replaces each plaintext letter with a different one, by a fixed number of places down the alphabet. The cipher illustrated here uses a left shift of three, so that (for example) each occurrence of E in the plaintext becomes B in the ciphertext.
For example
Plaintext: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.
Ciphertext: QEBNRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
PGM #2 ROT13:
Cipher Project 2 Create a similar Java program using ROT13 algorithm ROT13 is a common example of a cipher that was used quite frequently on numerous sites. It wasn’t ever really intended to prevent people from reading a message, but rather just to hide text
from the prying eyes. Most online sites use this function to ROT13 a message. Because with ROT13, you are shifting the alphabet 13 places, the same shift will return the text to its original position.
program 1:
main.js:
function main_fun() {
var plain_text = "HELLO WORLD I AM JAVA SRIPT CODER";
var shift = 3;
var encrypted_text = code(plain_text, shift, 'e');
var decrypted_text = code(encrypted_text, shift, 'd');
console.log("Plain Text: " + plain_text);
console.log("Shift: " + shift);
console.log("Encrypted Text: " + encrypted_text);
console.log("Decrypted Text: " + decrypted_text);
}
function code(text, shift, ch) {
var res = [];
if (ch === 'e') {
for (var i = 0; i < text.length; i++) {
if (text.charAt(i) != ' ') {
res[i] = String.fromCharCode(((text.charCodeAt(i) + shift - 65) % 26 + 65));
//shift by 13 positions and store in array of char type
} else
res[i] = ' ';
}
var result = res.join("");
//convert char array to string and return
return result;
} else if (ch === 'd') {
for (var i = 0; i < text.length; i++) {
if (text.charAt(i) != ' ') {
res[i] = String.fromCharCode(((text.charCodeAt(i) - shift + 65) % 26 + 65));
//shift by 13 positions and store in array of char type
} else
res[i] = ' ';
}
var result = res.join("");
//convert char array to string and return
return result;
} else
return null;
}main_fun();
Output:

Program2:
main.js:
function main_fun() {
var plain_text = "HELLO WORLD I AM JAVA SRIPT CODER";
var encrypted_text = code(plain_text, 13);
var decrypted_text = code(encrypted_text, 13);
console.log("Plain Text: " + plain_text);
console.log("Encrypted Text: " + encrypted_text);
console.log("Decrypted Text: " + decrypted_text);
}
function code(text, shift) {
var res = [];
for (var i = 0; i < text.length; i++) {
if (text.charAt(i) != ' ') {
res[i] = String.fromCharCode(((text.charCodeAt(i) + shift - 65) % 26 + 65));
//shift by 13 positions and store in array of char type
} else
res[i] = ' ';
}
var result = res.join("");
//convert char array to string and return
return result;
}
main_fun();
Output:

using the website repl.it (must be done in Javascript) PGM #1 Write a Java program that can perform the Caesar cipher fo...
Using the website Repl.it Write a Java program that can perform the Caesar cipher for English messages that include both upper and lowercase alphabetic characters. The Caesar cipher replaces each plaintext letter with a different one, by a fixed number of places down the alphabet. The program should be able to shift a specific number of places based on the user's input number. For example Plaintext: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG. Ciphertext: QEBNRFZH YOLTK CLU GRJMP...
Caesar Cipher v3 Decription Description A Caesar cipher is one of the first and most simple encryption methods. It works by shifting all letters in the original message (plaintext) by a certain fixed amount (the amounts represents the encryption key). The resulting encoded text is called ciphertext. Example Key (Shift): 3 Plaintext: Abc Ciphertext: Def Task Your goal is to implement a Caesar cipher program that receives the key and an encrypted paragraph (with uppercase and lowercase letters, punctuations, and...
USE C programming (pls label which file is libcipher.h and libcipher.c) Q4) A shift cipher is one of the simplest encryption techniques in the field of cryptography. It is a cipher in which each letter in a plain text message is replaced by a letter some fixed number of positions up the alphabet (i.e., by right shifting the alphabetic characters in the plain text message). For example, with a right shift of 2, ’A’ is replaced by ’C’, ’B’ is...
1) Echo the input: First, you should make sure you can write a program and have it compile and run, take input and give output. So to start you should just echo the input. This means you should prompt the user for the plaintext, read it in and then print it back out, with a message such as "this is the plaintext you entered:". [4 points, for writing a working program, echoing the input and submitting the program on the...
You will be writing a simple Java program that implements an ancient form of encryption known as a substitution cipher or a Caesar cipher (after Julius Caesar, who reportedly used it to send messages to his armies) or a shift cipher. In a Caesar cipher, the letters in a message are replaced by the letters of a "shifted" alphabet. So for example if we had a shift of 3 we might have the following replacements: Original alphabet: A B C...
Develop a Java application that uses a type of encrypted alphabet, called a random monoalphabetic cipher, to encrypt and decrypt a message. Your encryption key and message are to be read in from two different files and then the encrypted message will be output to third file. Then the encrypted message is read in and decrypted to a fourth file. A monoalphabetic cipher starts with an encryption word, removes the redundant letters from the word, and assigns what’s left to...