암호학/C언어(11)
-
sha-1
#include #include // strlen 쓰려고 using namespace std; void text_move(char *, int); int count1; void char_to_int(char text); void boohowha(int a); int binary_text[128]; int main() { count1 = 0; /* char text[128]; cout > text; cout
2021.05.12 -
Caesar Cipher(시저 암호) for C언어
시저(Caesar) 암호 = 카이사르 암호 = 케사르 암호 #include char symbols[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 !?."; void encrypt_mess(char* b) { int i, j; int encrypt_num; char ciphertext[200] = ""; printf("plain text : %s\n", b); for (i = 0; i < strlen(b); i++) { for (j = 0; j < strlen(symbols); j++) { if (symbols[j] == b[i]) { encrypt_num = (j + 13) % strlen(symbols); ciphertext[i..
2020.11.30 -
C언어 / 입력한 문자 거꾸로 출력
#include int main() { char input[10] = ""; char output[10] = ""; int i, j, k; printf("입력하세요 : "); scanf("%s", &input); printf("size : %d\n", strlen(input)); j = strlen(input); for(i = 0; i < strlen(input); i++) { output[i] = input[j-1]; //printf("%c", output[i]); j--; } printf("출력물 : %s\n", output); return 0; }
2020.11.29 -
C언어 / scanf 기본 출력
#include int main() { char a[] = ""; printf("입력하세요 : "); scanf("%s", &a); printf("출력물 : %s\n", a); printf("size : %d\n", strlen(a)); return 0; }
2020.11.29 -
affine Cipher(아핀 암호) for c언어
#include #include char SYMBOLS[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 !?."; char* encrypt_message(int key, char *b) // char* encrypt_message(int *key, char b[]) { int key_a, key_b; char ciphertext[200] = ""; int i = 0; int j = 0; int index; char tmp[] = " "; int num; printf("key : %d\n", key); printf("Origine text : %s\n", b); printf("symbol length is : %d\n", strlen..
2020.11.26