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

C# ¼ÓÃÜ£­TripleDES

TripleDES
Êô¶Ô³Æ¼ÓÃÜ£¬¶Ô³Æ¼ÓÃÜÔÚ¼ÓÃܺͽâÃÜʱ¶¼Ê¹ÓÃÏàͬµÄÃÜÔ¿£¬Ëٶȿ졣
TripleDESCryptoServiceProvider µÄÃû³Æ¿Õ¼äÊÇ£º
System.Security.Cryptography
byte[] plaintextBuffer = System.Text.Encoding.UTF8.GetBytes("Ã÷ÎÄ");
//¼ÓÃÜ
TripleDESCryptoServiceProvider tripleDES = new TripleDESCryptoServiceProvider();
ICryptoTransform transform = tripleDES.CreateEncryptor();
byte[] cipherTextBuffer = transform.TransformFinalBlock(plaintextBuffer, 0, plaintextBuffer.Length);
lbl.Text = Convert.ToBase64String(cipherTextBuffer) + "<br />";
transform.Dispose();
//½âÃÜ
TripleDESCryptoServiceProvider tripleDES2 = new TripleDESCryptoServiceProvider();
ICryptoTransform transform2 = tripleDES2.CreateDecryptor(tripleDES.Key, tripleDES.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)ÈçºÎ»ñÈ¡.gifͼƬÖеĸ÷¸öÖ¡£¿
(2)ÈçºÎ»ñȡͼƬµÄËõÂÔͼ£¿
(3)ÈçºÎ“½ØÈ¡”ͼƬµÄÖ¸¶¨ÇøÓò£¿
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
public class ImageHelp ......

C#±¾ÖÊÂÛ

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

ÀûÓÃC#µÄ¶¯Ì¬ÀàÐÍÀ´ÊµÏÖÓërailsÀàËÆµÄÔª±à³Ì(1)

ÊìϤruby on railsµÄ¿ª·¢Ô±¶¼ÖªµÀ£¬ÔÚrubyÖУ¬ÓÐÒ»¸öºÜÖØÒªµÄÌØÐÔ£¬¾ÍÊÇÄܹ»ÊµÏÖÔª±à³Ì£¬ÌرðÊÇÔÚÓÃÓÚ¿ª·¢WebÓ¦ÓõÄrails¿ò¼ÜÖУ¬ÓõÄÌØ±ð¶à¡£ÔÚrailsÖУ¬Òª´´½¨Ò»¸ö¶¯Ì¬·½·¨²¢ÓëÊý¾Ý¿â±í×Ö¶ÎÏà¹ØÁª£¬Ö÷ÒªµÄµÄ²½Öè´ó¸ÅÓÐÕâЩ£º
1¡¢Ê×ÏÈÅäÖúÃÊý¾Ý¿âµÄÁ¬½Ó¡£
2¡¢´´½¨Ò»¸öActiveRecordÄ£ÐÍ£¬Õâ¸öÄ£ÐÍÓëÊý¾Ý¿âµÄ±íÃû³ÆÓÐÒ»¶¨ ......

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ºÅ