컴퓨터 보안멀티미디어 전공200102636민 창 기2007. 10. 4.김 황 래 교수님/** 페리티 비트는 키 입력후 제거 됬음을 전제로 하고 있음.* 키 생성 부분.*/package org.des.function;import java.util.BitSet;//binary 연산을 위한 클레스모음public class DesKeyFunction {private String receiveKeyString;//입력받은 키의 원문 저장 변수private String binaryKeyString[];//각 키 문자의 binary 저장 변수private char receiveKeyStringToCharArray[];//입력받은 키를 문자로 저장 변수private BitSet bitset=new BitSet(56);//56개의 BitSet 을 저장private BitSet bitsetLK=new BitSet(28);//분리된 bitset 의 왼쪽 bitset 모음private BitSet bitsetRK=new BitSet(28);//분리된 bitset 의 오른쪽 bitset 모음private BitSet bitsetLP=new BitSet(28);//시프트를 위한 왼쪽 bitsetprivate BitSet bitsetRP=new BitSet(28);//시프트를 위한 오른쪽 bitsetprivate BitSet bitsetSubKey=new BitSet(48);//보조키를 위한 비트셋private BitSet bitsetNextKey=new BitSet(56);//다음회전에 들어갈 키public DesKeyFunction(String key){//생성자. 인자값(String 암호문, int 회전)receiveKeyString=key;//외부로의 입력키값 저장}public void setKey(){//문자열 키값을 binary 셋팅receiveKeyStringToCharArray=new char[receiveKeyString.length()];receiveKeyStringToCharArray=receiveKeyString.toCharArray();binaryKeyString=new String[receiveKeyStringToCharArray.length];for(int i=0;i