[컴퓨터보안 과제] 이중 단순 대체 암호기법의 안전성 분석 (자바JAVA 소스코드포함)
본 자료는 2페이지 의 미리보기를 제공합니다. 이미지를 클릭하여 주세요.
닫기
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
해당 자료는 2페이지 까지만 미리보기를 제공합니다.
2페이지 이후부터 다운로드 후 확인할 수 있습니다.

소개글

[컴퓨터보안 과제] 이중 단순 대체 암호기법의 안전성 분석 (자바JAVA 소스코드포함)에 대한 보고서 자료입니다.

목차

1. 아핀 암호에 대한 간략한 이해
2. 안전성 증대를 가져오지 못하는 이유 분석
3. 이를 응용한 간략한 프로그래밍 설계(Java 사용)

본문내용

feredReader;
import java.io.IOException;
import java.io.InputStreamReader;
class ciphering{
public String cipher(String ptext, int key){
int table[] = new int[26];
for(int i=0; i<26; i++){
table[i]=\'a\'+i;
}
int plength = ptext.length();
StringBuffer ctext = new StringBuffer();
for(int i =0; i int c = (int)ptext.charAt(i);
for(int j=0; j<26; j++){
if(table[j] == c){
ctext.append((char)table[((j*key)%26)]);
}
}
}
String chipertext = ctext.toString();
return chipertext;
}
}
public class Affine {
public static void main(String[] args){
ciphering e = new ciphering();
StringBuffer ptext = new StringBuffer();
String plaintext;
System.out.println(\"아핀 암호를 적용할 영문자를 입력하시오 : \");
int i;
try {
while( (i=System.in.read()) != \'\\n\' ){
ptext.append((char)i);
}
} catch (IOException e1) {
e1.printStackTrace();
}
plaintext = ptext.toString();
int key=0;
System.out.println(\"키 값을 입력해 주세요(1, 3, 5, 7, 9, 11, 15, 17, 19, 21, 23, 25)중 택1 : \");
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
try {
key = Integer.parseInt(bf.readLine());
} catch (IOException e1) {
e1.printStackTrace();
}
String ciphertext = e.cipher(plaintext, key);
System.out.println(\"암호화 된 암호문은 : \"+ciphertext);
int newkey=0;
for(int k=0; k<26; k++){
if((k*key)%26==1){
System.out.println(key+\"의 역함수:\"+k);
newkey=k;
}
}
plaintext = e.cipher(ciphertext, newkey);
System.out.println(\"복호화 된 평문은 : \"+plaintext);
}
}
< 출력 결과 >
cryptography -> evwrzcmvarbw -> cryptography
이로써 컴퓨터 보안 첫 번째 과제를 마치겠습니다. ^-^
  • 가격2,000
  • 페이지수7페이지
  • 등록일2015.03.25
  • 저작시기2014.6
  • 파일형식한글(hwp)
  • 자료번호#962254
본 자료는 최근 2주간 다운받은 회원이 없습니다.
청소해
다운로드 장바구니