❶ 二進制加密解密
簡單的異或加密,自己不寫是損失
==========
#include <cstdio>
using namespace std;
void binByte(char *bin, unsigned char b){
char i=7;
while(b>0){
bin[i]=(b&1)+'0';
b>>=1;
i--;
}
while(i>=0){
bin[i--]='0';
}
}
int main()
{
char *src="NCTV";
char bin[9]={0};
unsigned char *p=(unsigned char*)src;
unsigned char pwd=0x59;//1011001
unsigned char code;
while(*p!='\0'){
code=*p^pwd;
binByte(bin,*p);
printf("%c %u %s 加密成 %u ",*p,*p,bin,code);
binByte(bin,code);
printf("%s 解密成",bin);
code^=pwd;
binByte(bin,code);
printf(" %c %u %s",code,code,bin);
printf("\n");
p++;
}
return 0;
}
==============
輸出:
N 78 01001110 加密成 23 00010111 解密成 N 78 01001110
C 67 01000011 加密成 26 00011010 解密成 C 67 01000011
T 84 01010100 加密成 13 00001101 解密成 T 84 01010100
V 86 01010110 加密成 15 00001111 解密成 V 86 01010110
========
❷ c++運用ASCII對英文單詞進行加密解密
#include #include // 將十進制數decimal轉換為k進制數,並以字元串形式存放在字元數組s中 char *CountRule(int decimal,int k,char *s) { int ch,i,n; for(n = 0; decimal > 0; ++n) { s[n] = decimal%k + '0'; decimal /= k; } s[n] = '\0'; f
❸ 吧友有沒有對字元的加密解密有研究的
編寫程序,實現對任意字元串的加密和解密操作。其中,對大小寫英文字母的加密可以做呀,通過ASCII碼的位數改變就可以做到。
❹ VB ascii碼加密 問題
你的代碼貼出來
❺ C語言實現將字元串進行加密處理,每個字元的加密規則是,將其轉換為對應的ASCII碼加3後對應 的字元輸出
輸入的是英文字元的話,直接加3就可以,但是如果是中文字元的話,如果直接高位和地位加3也可以,但是解密的時候就有一個不確定的存在,因為中文字元的ascii編碼是有0xfe這樣的存在,加上3的話就到時候還原就變得不確定。所以如果是中文字元加密的話,應該把兩個ascii碼轉合並為兩個位元組無符號類型,然後再加3。
❻ 像這種"\u5475\u5475\"加密方法是如何解密,加密的。
解碼後:
"呵呵,真好,以前用測試版只能3個用戶。這個不限制用戶數量。謝謝"
--------------------------------------------------------------
JavaScript 源碼:
alert("\u5475\u5475\uff0c\u771f\u597d\uff0c\u4ee5\u524d\u7528\u6d4b\u8bd5\u7248\u53ea\u80fd3\u4e2a\u7528\u6237\u3002\u8fd9\u4e2a\u4e0d\u9650\u5236\u7528\u6237\u6570\u91cf\u3002\u8c22\u8c22")
❼ 寫出對字元串中的字元ASCII值進行運算來進行加密和解密的演算法
http://blog.163.com/asm_c/blog/static/248203113201010244230947/
參考。
❽ 高分求救,md5在線解密,在線等!!!!!
MD5隻有16位和32位的 不存在20位的現象
你可以登陸伺服器或FTP 把備份的資料庫還原回去
或者把備份資料庫里的20位的加密密碼 替換到原來資料庫里 就可以了
❾ hex轉ascii
unit encodeAndDecode;
{
該單元實現對字元串的簡單加密解密。
加密方法是取得一個char的ASCII碼,然後把它轉換成十六進制。
}
interface
uses SysUtils;
function encode(source:string):string;
function decode(source:string):string;
implementation
function encode(source:string):string;
var
i,Ascii,strLen:integer;
a:char;
hex:string;
begin
result:='';
strLen:=length(source);
for i:=1 to strLen do
begin
a:=source[i];
ascii:=ord(a);
hex:=intToHex(ascii,2);
result:=result+hex;
end;
end;
function decode(source:string):string;
var
i,ascii,strLen:integer;
a:char;
str:string;
begin
strLen:=length(source);
result:='';
i:=1;
while i<= strlen do
begin
str:=(source,i,2);
ascii:=strToint('$'+str);
a:=chr(ascii);
result:=result+a;
inc(i,2);
end;
end;
end.
能看懂上面的代碼,你就會了!
❿ 加密解密
/*維吉尼亞密碼(Vigenère Cipher)
加密程序v1.0
0 error(s), 0 warning(s)
Dolphin*/
#include<iostream>
#include<string>
using namespace std;
#include<conio.h>
char Toupper(char ch)
{//把小寫字母轉換成大寫字母
if(ch >= 'A' && ch <= 'Z')
return ch;
else if(ch >= 'a' && ch <= 'z')
return ch - 'a' + 'A';
else return 0;
}
int AlphaToNum(char ch)
{//把字母轉換成對應的數字
return Toupper(ch) - 'A';
}
char NumToAlpha(int num)
{//把數字轉換成對應的字母
return num + 'A';
}
void main()
{
string strPlaintext;
string strCiphertext;
string strTemp;
string strKey;
string strKeyStream;
cout<<"明文:"<<endl;
cin>>strPlaintext;
strCiphertext = strTemp = strPlaintext;
for(string::iterator si = strTemp.begin();si != strTemp.end();si++)
*si = Toupper(*si);
cout<<"密鑰:"<<endl;
cin>>strKey;
for(si = strKey.begin();si != strKey.end();si++)
*si = Toupper(*si);
for(int i = 0;i <= strTemp.length() / strKey.length();i++)
strKeyStream += strKey;
for(i = 0;i < strTemp.length();i++)
strCiphertext[i] = NumToAlpha((AlphaToNum(strTemp[i]) + AlphaToNum(strKeyStream[i])) % 26);
cout<<"密文:"<<endl;
cout<<strCiphertext<<endl;
getch();
}