ÇÁ·Î±×·¡¹Ö

 3204, 18/161 ȸ¿ø°¡ÀÔ  ·Î±×ÀΠ 
   shtjdanr
   ºñÁî³×¸£ ¾ÏÈ£ÄÚµù..Çؼ®Á»..¤Ì¤Ð.¤Ì ºÎŹµå¸³´Ï´Ù..¤Ð.¤Ð ÁøÂ¥ ¸ð¸£°Ù³×¿ä..

http://www.hackerschool.org/HS_Boards/zboard.php?id=QNA_programming&no=1718 [º¹»ç]


#include <stdio.h>
#define ABS(a)  a<0?26+a:a

void UpperCase(char* str);
void encryption(char* plaintext, char* ciphertext, char* key);
/*void decryption(char* plaintext, char* ciphertext, char* key);*/


void main(void)
{
      char key[15]="kim";
      char ciphertext[1024], plaintext[1024];

      printf("¾ÏȣȭÇÒ ¹®ÀåÀ» ÀÔ·ÂÇϼ¼¿ä: ");
      gets(plaintext);
      UpperCase(plaintext);
      encryption(plaintext, ciphertext, key);
      printf("¾ÏÈ£¹® : %s\n", ciphertext);

      /*decryption(plaintext, ciphertext, key);*/
      /*printf("º¹È£¹® : %s\n", plaintext);*/
}



void UpperCase(char* str)
{
      for(int i=0;str[i];i++)
      {
            if(str[i]>='a' && str[i]<='z')
                  str[i] = str[i]-'a' + 'A';
      }
}




void encryption(char* plaintext, char* ciphertext, char* key)
{
      int keylen=0, keycnt=0;

      while(key[keylen++]);  //¾ÏȣŰ ±æÀ̸¦ ±¸ÇÔ
      keylen--;



      for(int i=0;plaintext[i];i++)
      {
            if(plaintext[i] == ' ')
                  ciphertext[i] = ' ';
            else
                  ciphertext[i] = (plaintext[i]+key[keycnt++%keylen])%65 %26 + 'A';
      }
      ciphertext[i]='\0';
}

  Hit : 7581     Date : 2008/10/11 09:11



    
2864   ºñÁÖ¾ó 6.0 exeÆÄÀÏ ¾ÆÀÌÄÜ ¾î¶»°Ô ³Ö´Â°Ç°¡¿ä?[2]     shdac
01/04 3788
  ºñÁî³×¸£ ¾ÏÈ£ÄÚµù..Çؼ®Á»..¤Ì¤Ð.¤Ì ºÎŹµå¸³´Ï´Ù..¤Ð.¤Ð ÁøÂ¥ ¸ð¸£°Ù³×¿ä..     shtjdanr
10/11 7580
2862   ºñÁê¾ó½ºÆ©µð¿À¸¦ »ç¿ëÇÒ¶§ ³ª¿À´Â È®Àå¿¡ ´ëÇؼ­ ±Ã±ÝÇÑ°Ô ÀÖ½À´Ï´Ù..^^[1]     liveai
10/23 2420
2861   ºñÁê¾óc++¿¡¼­..[2]     ¹é·æÃâÇØ
03/30 2966
2860   ºñÁê¾óC++ ÇÁ·Î±×·¥ ±âÃÊÀûÀÎ Áú¹®ÀÔ´Ï´Ù![8]     lllxyxylll
07/14 2410
2859   ºñÁê¾ó ½ºÆ©µð¿À ¸»°í ´Ù¸¥ °Í?[3]     todaywin2
04/19 4101
2858   ºñÁê¾ó ½ºÆ©µð¿À ÄÄÆÄÀÏ/µð¹ö±ë °ü·Ã ºÎŹµå¸±²²¿ä[2]     salis
02/20 3016
2857   ºñÁê¾ó ½ºÆ©µð¿À 2008 express editionÀ» ´Ù¿î ¹Þ¾Ò´Âµ¥¿ä[2]     gkswls123
05/01 4572
2856   ºñÁê¾ó ½ºÆ©µð¿À 2005[5]     tmddyd1095
03/24 2993
2855   ºñÁê¾ó º£ÀÌÁ÷ Áú¹®ÀÌ¿ä~     SnarlWolf
04/04 2303
2854   ºñÁê¾ó º£ÀÌÁ÷ 6.0À¸·Î ¼ÒÄÏ ÇÁ·Î±×·¡¹Ö Áú¹®ÀÌ¿ä.[2]     kiskind
10/01 3044
2853   ºí·Î±× È«º¸ÇÒ¶§¾²´Â ¸ÞŸÅ×±× µµ¿ÍÁÖ¼¼¿ä.[2]     o0ok2o0
09/26 2586
2852   ºí·ç½ºÅ©¸° ¼Ò½º[5]     h@cking2013
03/23 6709
2851   ºÎÆÃÀ» c ¾ð¾î·Î Â¥¿©Áø °ÍÀÔ´Ï´Ù.. Áú¹®¿ä....[3]     superio1999
04/06 3947
2850   ºÎŹµå¸±°Ô¿ä ¤Ð¤Ð[4]     namja333
07/31 2452
2849   ºê¶ó¿ìÀú¿¡¼­(ÀÎÅͳÝÀͽºÇ÷η¯) ¼Ò½ºº¸±â°¡¾ÈµÈ´Ù°í°¡Á¤ÇÒ¶§[12]     mudaebbo
02/10 2969
2848   ¹Ø¿¡ ¾î¶²´ÔÀÌ ÇѰǵ¥,, ºÐ¼®Á»ÇØÁÖ¼¼¿ä[2]     JJang777
01/06 3706
2847   ¹» °øºÎÇØ¾ß µÉÁö ¸ð¸£°Ù¾î¿ä...¤Ð¤Ì[5]     soul214
12/28 2643
2846   ¹¹ºÎÅÍ ¹è¿ö¾ß µÉÁö?[1]     momma1004
08/10 2932
2845   ¹¹°¡ ¿¡·¯ÀΰÇÁö[2]     goeun30
06/26 3272
[1]..[11][12][13][14][15][16][17] 18 [19][20]..[161]

Copyright 1999-2024 Zeroboard / skin by Hackerschool.org / Secure Patch by Hackerschool.org