TEA 와 RSA 알고리즘 프로그램과 레포트입니다.
- 최초 등록일
- 2009.06.05
- 최종 저작일
- 2009.06
- 14페이지/ 압축파일
- 가격 2,000원
소개글
TEA와 RSA 알고리즘 프로그램과 제포트 입니다.
TEA알고리즘 실행할 때요~
tea.h 파일과 tea.cpp(소스파일) 로 실행 시키시면 됩니다.
그럼 decode 파일하고 data.enc.tea 파일이 생성 되는데요
data.enc.tea 가 암호화 된 것을 나타내는 것입니다.
RSA는 레포트의 2번에 파일을 같다 사용하시면 됩니다~
컴퓨터 보안 혹은 정보보호개론 듣는 학생분들은 참고가 될 것입니다~
목차
1.다음에 주어진 Symmetric cryptography algorithm을 임의의 Plain text 와 Key 로서 실습하시오. (TEA 알고리즘)
2.다음에 주어진 내용을 참고해서, RSA Cryptography algorithm을 기술하고 임의의 Plain text 로서 실습하시오
본문내용
1. 다음에 주어진 Symmetric cryptography algorithm을 임의의 Plain text 와 Key 로서 실습하시오.
void encrypt(unsigned long k[], unsigned long text[]) {
unsigned long y = text[0], z = text[1];
unsigned long delta = 0x9e3779b9, sum = 0; int n;
for (n= 0; n < 32; n++) {
sum += delta;
y += ((z << 4) + k[0]) ^ (z+sum) ^ ((z >> 5) + k[1]);
z += ((y << 4) + k[2]) ^ (y+sum) ^ ((y >> 5) + k[3]);
}
text[0] = y; text[1] = z;
}
void decrypt(unsigned long k[], unsigned long text[]) {
unsigned long y = text[0], z = text[1];
unsigned long delta = 0x9e3779b9, sum = delta << 5; int n;
for (n= 0; n < 32; n++) {
z -= ((y << 4) + k[2]) ^ (y + sum) ^ ((y >> 5) + k[3]);
y -= ((z << 4) + k[0]) ^ (z + sum) ^ ((z >> 5) + k[1]);
sum -= delta;
}
text[0] = y; text[1] = z;
}
void tea(char mode, FILE *infile, FILE *outfile, unsigned long k[]) {
/* mode is ’e’ for encrypt, ’d’ for decrypt, k[] is the key.*/
char ch, Text[8]; int i;
while(!feof(infile)) {
i = fread(Text, 1, 8, infile); /* read 8 bytes from infile into Text */
if (i <= 0) break;
while (i < 8) { Text[i++] = ` `;} /* pad last block with spaces */
switch (mode) {
case `e`:
encrypt(k, (unsigned long*) Text); break;
case `d`:
decrypt(k, (unsigned long*) Text); break;
}
fwrite(Text, 1, 8, outfile); /* write 8 bytes from Text to outfile */
참고 자료
정보보호개론
압축파일 내 파일목록
Tea구현.zip
컴보과제_2.doc