我是JS的初学者。我试着理解凯撒密码ROT13,但对我来说太复杂了。所以我试着写自己的代码。如下所示:
function encrip() {
var alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R
我正在尝试实现一个基本的凯撒移位密码用于Java,以便在13之前转换所有的字母。
public static String cipher(String sentence){
String s = "";
for(int i = 0; i < sentence.length(); i++){
char c = (char)(sentence.charAt(i) + 13);
if (c > 'z')
s += (char)(sentence.charAt(i) - 13);
尝试将字符串写入新文件,但当我打开新文件时,它只显示最后一个字符。完全加密是包含随机ASCII值的字符串。
ciphername=input('Choose the name of the file the encrypted message will be put into: ')
ciphertext=open(ciphername +'.txt','w')
ciphertext.write(str(FullEncrypt))
ciphertext.close()
完全加密是:
EncryptFile=input(
我试图使用一个密码和一个存储在数组中的vigenere正方形来加密和解密一条消息。我能够成功地加密这条消息,但是后来我想不出如何再次解密它。有什么想法吗?
#include <stdio.h>
#include <string.h>
#include <ctype.h>
void encrypt(char *text, char *pass, int n, int m, char *vs);
void decrypt(char *text, char *pass, int n, int m, char *vs);
void vigsq(char *vs);