Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

C# ¼ÓÃÜ£­Rijndael

Rijndael
Êô¶Ô³Æ¼ÓÃÜ£¬¶Ô³Æ¼ÓÃÜÔÚ¼ÓÃܺͽâÃÜʱ¶¼Ê¹ÓÃÏàͬµÄÃÜÔ¿¡£2000 Äê 10 Ô£¬NIST Ñ¡Ôñ Rijndael£¨·¢ÒôΪ "Rhine dale"£©×÷Ϊ AES Ëã·¨£¬ÓÃÒÔÈ¡´ú DES¡£
Rijndael µÄÃû³Æ¿Õ¼äÊÇ£º
System.Security.Cryptography
byte[] plaintextBuffer = System.Text.Encoding.UTF8.GetBytes("Ã÷ÎÄ");

//¼ÓÃÜ
Rijndael rijndael = Rijndael.Create();
ICryptoTransform transform = rijndael.CreateEncryptor();
byte[] cipherTextBuffer = transform.TransformFinalBlock(plaintextBuffer, 0, plaintextBuffer.Length);
lbl.Text = Convert.ToBase64String(cipherTextBuffer) + "<br />";
transform.Dispose();

//½âÃÜ
Rijndael rijndael2 = Rijndael.Create();
ICryptoTransform transform2 = rijndael2.CreateDecryptor(rijndael.Key, rijndael.IV);
byte[] decryption = transform2.TransformFinalBlock(cipherTextBuffer, 0, cipherTextBuffer.Length);
lbl.Text += System.Text.Encoding.UTF8.GetString(decryption) + "<br />";
transform2.Dispose();
½âÃÜʱ£¬Ê¹ÓüÓÃÜµÄ Key ºÍ IV¡£


Ïà¹ØÎĵµ£º

ʹÓÃC#ÕýÔò±í´ïʽƥÅäÏà¹Ø×Ö·û´®

C#ÕýÔò±í´ïʽƥÅä×Ö·û´®µÄ·½·¨ÈçÏ£º
1.ʹÓÃC#ÖÐʹÓÃÕýÔò±í´ïʽSystem.Text.RegularExpressionsÃüÃû¿Õ¼ä£»
2.ʹÓÃC#ÖÐʹÓÃÕýÔò±í´ïʽMatches()·½·¨Æ¥Åä×Ö·û´®£¬¸ñʽÈçÏ£º
MatchCollection Matches = Regex.Matches(Str, Pattern, RegexOptions.IgnoreCase | RegexOptions.ExplicitC ......

C#±¾ÖÊÂÛ

»ùÀàµÄÖØÐ´£º
new:£¨½öÕë¶ÔÅÉÉúÀàÓÃÅÉÉúʵÀýµ÷ÓÃʱ²ÅÆð×÷Óã¬Ä¿µÄÊÇÔÚÅÉÉúÀàÖÐÓÃÀ´¸²¸Ç»ùÀàµÄ·½·¨£©
1.ÅÉÉúÀ๹½¨³ÉµÄʵÀý£¬µ±µ÷ÓÃÓÉnew ÐÞÊεķ½·¨Ê±£¬¸²¸Ç»ùÀànew ·½·¨¡£
2.ÅÉÉúÀ๹½¨³ÉµÄʵÀý¸³¸ø»ùÀà±äÁ¿Ê±£¬ÔÙµ÷ÓÃÓÉnew ÐÞÊεķ½·¨Ê±£¬½«Ö´ÐлùÀàÖеķ½·¨¡£
virtual¡¢override
1.ÓÉÅÉÉúÀ๹½¨µÄʵÀý£¬²»¹ÜÊÇÓÃÅÉÉ ......

RFC·ÃÎÊSAP(C#)


using System.Windows.Forms;
using SAPFunctionsOCX;
using SAPLogonCtrl;
using SAPTableFactoryCtrl;
namespace SAPFunction
{
    public partial class Form1 : Form
    {
        public Form1()
       ......

C# ¼ÓÃÜ£­RSA ¸ß¼¶

RSA
ʵ¼ÊÓ¦ÓÃÖÐÊÇ£º½ÓÊÕ·½²úÉú¹«Ô¿ºÍ˽Կ£¬·¢ËÍ·½ÓÃÆä¹«Ô¿¼ÓÃÜ£¬ÔٰѼÓÃܺóµÄÄÚÈÝ·¢Ë͸ø½ÓÊÕ·½¡£
CspParameters
µÄÃû³Æ¿Õ¼äÊÇ£º
System.Security.Cryptography
CspParameters cpSend = new CspParameters(); //Csp = Cryptography Service Provider
CspParameters cpReceive = new CspParameters();
cpSend.KeyCon ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ