herrDeng網內搜尋

自訂搜尋

Ads

2013年9月25日 星期三

破解Caesar挪移碼

破解Caesar挪移碼JVMVEKVVE


提示:以下為加密的部份,破解請用暴力破解,共25把金鑰而已

54 則留言:

B10133048 饒家華 提到...

public class CS {

static String encrypt(String plaintext, int key){
char [] m=plaintext.toCharArray();
char [] c=new char[m.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'a'+26-key)%26+'A');
String ciphertext=new String(m);
return ciphertext;
}
public static void main(String[] args) {
String plaintext="caesar";
int key=3;
System.out.println(encrypt(plaintext,key));
}

}

B10133105黃章瑋 提到...

seventeen

B10133101 郭家維 提到...

SEVENTEEN

B10133125葉志翔 提到...

public class CaesarShiftCipher {
static String encrypt(String plaintext, int key){
plaintext=plaintext.replace(" ","").
toLowerCase();
char [] m=plaintext.toCharArray();
char [] c=new char[m.length];
for (int i=0; i<m.length; i++)
c[i]=(char)((m[i]-'a'+26+key)%26+'A');
String ciphertext=new String(c);
return ciphertext;
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}
public static void main(String[] args) {
String plaintext="JVMVEKVVE";
int key=9;
String ciphertext=encrypt(plaintext, key );
System.out.println(ciphertext);
System.out.println(decrypt(ciphertext, key));
}
}

key=9
SEVENTEEN

B10133136 鄧暢 提到...

public class CaesarShiftCipher {
static String encrypt(String plaintext, int key){
plaintext=plaintext.replace(" ","").
toLowerCase();
char [] m=plaintext.toCharArray();
char [] c=new char[m.length];
for (int i=0; i<m.length; i++)
c[i]=(char)((m[i]-'a'+26+key)%26+'A');
String ciphertext=new String(c);
return ciphertext;
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}
public static void main(String[] args) {
String plaintext="JVMVEKVVE";
int key=9;
String ciphertext=encrypt(plaintext, key );
System.out.println(ciphertext);
System.out.println(decrypt(ciphertext, key));
}
}

B10133002 謝佩紋 提到...

public class ex1 {

static String encrypt(String plaintext, int key){
char [] m=plaintext.toCharArray();
char [] c=new char[m.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'a'+26-key)%26+'A');
String ciphertext=new String(m);
return ciphertext;
}
public static void main(String[] args) {
String plaintext="caesar";
int key=3;
System.out.println(encrypt(plaintext,key));
}

}

B10133066 葉佳欣 提到...

key:17
明文:seventeen

B10133011 黃怡蓁 提到...

public class aaa
{
public static void main(String[] args)
{
String ciphertext="JVMVEKVVE";
for (int key=1;key<=26;key++)
System.out.println(decrypt(ciphertext,key));
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}
}

B10133042沈俞宜 提到...

package p1;
public class ket
{
public static void main(String[] args)
{
String ciphertext="JVMVEKVVE";
for (int key=1;key<=26;key++)
System.out.println(decrypt(ciphertext,key));
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}
}

B10133047鄭兆珊 提到...

package p1;
public class san
{
public static void main(String[] args)
{
String ciphertext="JVMVEKVVE";
for (int key=1;key<=26;key++)
System.out.println(decrypt(ciphertext,key));
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}
}

B10133033呂之筠 提到...

package p1;
public class wie
{
public static void main(String[] args)
{
String ciphertext="JVMVEKVVE";
for (int key=1;key<=26;key++)
System.out.println(decrypt(ciphertext,key));
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}
}

B10133014 吳欣怡 提到...

public class ex1{

static String encrypt(String plaintext, int key){
char [] m=plaintext.toCharArray();
char [] c=new char[m.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'a'+26-key)%26+'A');
String ciphertext=new String(m);
return ciphertext;
}
public static void main(String[] args) {
String plaintext="caesar";
int key=3;
System.out.println(encrypt(plaintext,key));
}

}

B10133121劉祐樺 提到...

程式碼太長了
我簡短說明
int key=9;
明文:SEVENTEEN

B10133169 鄭佳淵 提到...

public class Caesar
{
public static void main(String[] args)
{
String ciphertext="JVMVEKVVE";
for (int key=1;key<26;key++)
System.out.println("key="+key+" "+decrypt(ciphertext,key));
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}

}

B10135027劉承恩 提到...

package p1;
public class wie
{
public static void main(String[] args)
{
String ciphertext="JVMVEKVVE";
for (int key=1;key<=26;key++)
System.out.println(decrypt(ciphertext,key));
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}
}

key:17
明文:seventeen

b10135002吳叔頻 提到...

Seventeen
Key=17

匿名 提到...

B10133139_林志鴻
資管二丙

public class CaesarShiftCipher {
static String encrypt(String plaintext, int key){
plaintext=plaintext.replace(" ","").
toLowerCase();
char [] m=plaintext.toCharArray();
char [] c=new char[m.length];
for (int i=0; i<m.length; i++)
c[i]=(char)((m[i]-'a'+26+key)%26+'A');
String ciphertext=new String(c);
return ciphertext;
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}
public static void main(String[] args) {
String plaintext="JVMVEKVVE";
int key=9;
String ciphertext=encrypt(plaintext, key );
System.out.println(ciphertext);
System.out.println(decrypt(ciphertext, key));
}
}

B10031020莊家翔 提到...

public class CaesarShiftCipher {
static String encrypt(String plaintext, int key){
plaintext=plaintext.replace(" ","").
toLowerCase();
char [] m=plaintext.toCharArray();
char [] c=new char[m.length];
for (int i=0; i<m.length; i++)
c[i]=(char)((m[i]-'a'+26+key)%26+'A');
String ciphertext=new String(c);
return ciphertext;
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}
public static void main(String[] args) {
String plaintext="JVMVEKVVE";
int key=9;
String ciphertext=encrypt(plaintext, key );
System.out.println(ciphertext);
System.out.println(decrypt(ciphertext, key));
}
}

key=9
SEVENTEEN

B10133036孫翊玲 提到...

key:
明文:SEVENTEEN

B10133036孫翊玲 提到...

Key:17
明文:SEVENTEEN

B9933123 郭美怡 提到...

SEVENTEEN

b9933167 梁郁琪 提到...

SEVENTEEN

B9933128吳以涵 提到...

SEVENTEEN

B10133040 溫翊惠 提到...

SEVENTEEN

b9833072邱良弘 提到...

SEVENTEEN
金鑰為17


b9633010詹天佑 提到...

金鑰為17
SEVENTEEN

B10133002 謝佩紋 提到...

seventeen

B10133184 涂家昇 提到...

Seventeen
Key=17

B10133014 吳欣怡 提到...

public class Caesar
{
public static void main(String[] args)
{
String ciphertext="JVMVEKVVE";
for (int key=1;key<=26;key++)
System.out.println(decrypt(ciphertext,key));
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}
}

B10031041 謝東諺 提到...

seventeen

B9933029江軒澔 提到...

key:17
明文:seventeen

B9833183陳干騏 提到...

package AA111;
public class ket
{
public static void main(String[] args)
{
String ciphertext="JVMVEKVVE";
for (int key=1;key<=26;key++)
System.out.println(decrypt(ciphertext,key));
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}
}

B9933137 黃宇儂 提到...

package p1;
public class key
{
public static void main(String[] args)
{
String ciphertext="JVMVEKVVE";
for (int key=1;key<=26;key++)
System.out.println(decrypt(ciphertext,key));
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}
}

B10031063 許時睿 提到...

package p1;
public class san
{
public static void main(String[] args)
{
String ciphertext="JVMVEKVVE";
for (int key=1;key<=26;key++)
System.out.println(decrypt(ciphertext,key));
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}
}

B10033123 莫凱慈 提到...

SEVENTEEN

B9933087楊文良 提到...

SEVENTEEN

B9933076 陳德輝 提到...

key:17
明 :seventeen

B10133168 封明成 提到...

seventeen

B9933080 盧永霖 提到...

public class CaesarShiftCipher {
static String encrypt(String plaintext, int key){
plaintext=plaintext.replace(" ","").
toLowerCase();
char [] m=plaintext.toCharArray();
char [] c=new char[m.length];
for (int i=0; i<m.length; i++)
c[i]=(char)((m[i]-'a'+26+key)%26+'A');
String ciphertext=new String(c);
return ciphertext;
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}
public static void main(String[] args) {
String plaintext="JVMVEKVVE";
int key=9;
String ciphertext=encrypt(plaintext, key );
System.out.println(ciphertext);
System.out.println(decrypt(ciphertext, key));
}
}

B10133031 邱敏惠 提到...

public class abc
{
public static void main(String[] args)
{
String ciphertext="JVMVEKVVE";
for (int key=1;key<=26;key++)
System.out.println(decrypt(ciphertext,key));
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}
}

b10133030林潔如 提到...

public class ex {

static String encrypt(String plaintext, int key){
char [] m=plaintext.toCharArray();
char [] c=new char[m.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'a'+26-key)%26+'A');
String ciphertext=new String(m);
return ciphertext;
}
public static void main(String[] args) {
String plaintext="caesar";
int key=3;
System.out.println(encrypt(plaintext,key));
}

}

b10031017 徐瑞謚 提到...

Seventeen
Key=17

B9933028彭雯良 提到...

SEVENTEEN

B10133162 楊杰霖 提到...

public class CaesarShiftCipher {
static String encrypt(String plaintext, int key){
plaintext=plaintext.replace(" ","").
toLowerCase();
char [] m=plaintext.toCharArray();
char [] c=new char[m.length];
for (int i=0; i<m.length; i++)
c[i]=(char)((m[i]-'a'+26+key)%26+'A');
String ciphertext=new String(c);
return ciphertext;
}
static String decrypt(String ciphertext, int key){
char [] c=ciphertext.toCharArray();
char [] m=new char[c.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'A'+26-key)%26+'a');
String plaintext=new String(m);
return plaintext;
}
public static void main(String[] args) {
String plaintext="JVMVEKVVE";
int key=9;
String ciphertext=encrypt(plaintext, key );
System.out.println(ciphertext);
System.out.println(decrypt(ciphertext, key));
}
}

B10133045林玹安 提到...

SEVENTEEN

B10133168封明成 提到...

seventeen

Unknown 提到...

b10041032林佳雯
public class Caesar {public static void main(String[] args) {String ciphertext="JVMVEKVVE";for (int key=1;key<26;key++)System.out.println("key="+key+" "+decrypt(ciphertext,key));}static String decrypt(String ciphertext, int key){char [] c=ciphertext.toCharArray();char [] m=new char[c.length];for (int i=0; i<c.length; i++)m[i]=(char)((c[i]-'A'+26-key)%26+'a');String plaintext=new String(m);return plaintext;}}

B10132143 陳又婉 提到...

seventeen

B10033170黃筱雯 提到...

public class ex1{

static String encrypt(String plaintext, int key){
char [] m=plaintext.toCharArray();
char [] c=new char[m.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'a'+26-key)%26+'A');
String ciphertext=new String(m);
return ciphertext;
}
public static void main(String[] args) {
String plaintext="caesar";
int key=3;
System.out.println(encrypt(plaintext,key));
}

}

B10033150胡錦成 提到...

public class ex1{

static String encrypt(String plaintext, int key){
char [] m=plaintext.toCharArray();
char [] c=new char[m.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'a'+26-key)%26+'A');
String ciphertext=new String(m);
return ciphertext;
}
public static void main(String[] args) {
String plaintext="caesar";
int key=3;
System.out.println(encrypt(plaintext,key));
}

}

B10133083莊子意 提到...

key:17
明文:seventeen

B10133049 連于瑄 提到...

public class CS {

static String encrypt(String plaintext, int key){
char [] m=plaintext.toCharArray();
char [] c=new char[m.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'a'+26-key)%26+'A');
String ciphertext=new String(m);
return ciphertext;
}
public static void main(String[] args) {
String plaintext="caesar";
int key=3;
System.out.println(encrypt(plaintext,key));
}

}

B10133046 邱誌寬 提到...

public class CSC {

static String encrypt(String plaintext, int keys){
char [] m=plaintext.toCharArray();
char [] c=new char[m.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'a'+26-keys)%26+'A');
String ciphertext=new String(m);
return ciphertext;
}
public static void main(String[] args) {
String plaintext="caesar";
int keys=3;
System.out.println(encrypt(plaintext,key));
}

}

B10133045 林玹安 提到...

public class CS {

static String encrypt(String plaintext, int keys){
char [] m=plaintext.toCharArray();
char [] c=new char[m.length];
for (int i=0; i<c.length; i++)
m[i]=(char)((c[i]-'a'+26-keys)%26+'A');
String ciphertext=new String(m);
return ciphertext;
}
public static void main(String[] args) {
String plaintext="caesar";
int keys=3;
System.out.println(encrypt(plaintext,keys));
}

}

Related Posts Plugin for WordPress, Blogger...

熱門文章