91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1KB
    文件類型: .rar
    金幣: 2
    下載: 1 次
    發布日期: 2021-06-25
  • 語言: C/C++
  • 標簽: RC4??

資源簡介

RC4很簡單、很快速,再上一個C語言版本的RC4

資源截圖

代碼片段和文件信息

#include?

/*?Prototype?the?encryption/decryption?function?????*/
char?*EnDeCrypt(const?char?*pszText?int?iTextLen?const?char?*pszKey);
void?swapints(int?*array?int?ndx1?int?ndx2);

/*?Test?harness?for?the?EnDeCrypt?function?below.???*/
int?main()
{
????char?buf[256]?passwd[16]?*pEncrypted?*pDecrypted?*pch;
????int?ix?iLen;

????for?(;;)
????{
????????printf(“\nString?to?encrypt?(just?Enter?to?exit):?“);
????????fgets(buf?sizeof(buf)?stdin);
for?(ix?=?strlen(buf)?-?1;?(ix?>=?0)?&&?(buf[ix]?==?10);?ix--)
buf[ix]?=?0;
????????if?(!buf[0])
????????????break;
????????printf(“\nKey:?“);
????????fgets(passwd?sizeof(passwd)?stdin);
for?(ix?=?strlen(passwd)?-?1;?(ix?>=?0)?&&?(passwd[ix]?==?10);?ix--)
passwd[ix]?=?0;
????????if?(!passwd[0])
????????????break;
iLen?=?strlen(buf);
????????pEncrypted?=?EnDeCrypt(buf?iLen?passwd);
????????printf(“\nEncrypted?output:\n“);
????????for?(pch?=?pEncrypted?ix=0;?ix?????????{
????????????if?(!(ix?%?20))
????????????????printf(“\n“);
????????????printf(“%1X?“?(unsigned?char)*pch);
????????}
????????pDecrypted?=?EnDeCrypt(pEncrypted?iLen?passwd);
pDecrypted[iLen]?=?0; /*?Null-terminate?*/
????????printf(“\nDecrypted?text:?%s“?pDecrypted);
????????free(pEncrypted);
????????free(pDecrypted);
????}
????return?0;
}

/*?:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
???;:::?????????????????????????????????????????????????????????????:::
???;:::??This?function?performs?‘RC4‘?Stream?Encryption?????????????:::
???;:::??(based?on?what?is?widely?thought?to?be?RSA‘s?RC4???????????:::
???;:::??algorithm.?It?produces?output?streams?that?are?identical???:::
???;:::??to?the?commercial?products)????????????????????????????????:::
???;:::?????????????????????????????????????????????????????????????:::
???;:::??Adapted?by?permission?from?a?VB?script?by?Mike?Shaffer?????:::
???;:::??http://www.4guysfromrolla.com/webtech/010100-1.shtml???????:::
???;:::?????????????????????????????????????????????????????????????:::
???;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::?*/

char?*EnDeCrypt(const?char?*pszText?int?iTextLen?const?char?*pszKey)
/*?;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
???;:::??This?routine?does?all?the?work.?Call?it?both?to?ENcrypt????:::
???;:::??and?to?DEcrypt?your?data.??????????????????????????????????:::
???;:::??You?MUST?free?the?returned?pointer?when?no?longer?needed???:::
???;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::?*/
{
????char?*cipher;???????????????????????/*?Output?buffer????????????????*/
????int?a?b?i=0?j=0?k;??????????????/*?Ambiguously?named?counters???*/
????int?ilen;???????????????????????????/*?Length?of?a?string???????????*/
????int?sbox[256];??????????????????????/*?Encryption?array?????????????*/
????int?key[256];???????????????????????/*?Numeric?key?values???????????*/


?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????3690??2008-02-01?10:28??c_rc4\rc4.c

?????目錄??????????0??2008-09-09?18:17??c_rc4

-----------?---------??----------?-----??----

?????????????????3690????????????????????2


評論

共有 條評論