AKB Forums

Go Back   AKB Forums > Technical sections > Algorithms
Home Register Blogs FAQ Members List Calendar Downloads Arcade Mark Forums Read

Algorithms The source of algorithms for your project

Troubles when posting message? Click here! :: Проблемы с отправлением сообщения? Нажмите сюда!

Reply
 
LinkBack Thread Tools Display Modes
Old Sep 9, 2008, 17:12   #1
Академик
 
Join Date: Jan 2002
Location: Shambala
Posts: 6,838
Rep Power: 8
Reputation: 209
Send a message via ICQ to Երեխա
C# Des 3DES

Txner uremn C++ ov ka realizacvac 3DES i inch vor mi algoritm vor vor

hello (unicode darcrac)

encrypt a anum u stacvuma hetevyal Byte Array

0D:59:00:EA:7F:7C:1E:91:FF:E7:B6:066:71:C1:A2

hima porcum em nuyn ban grel C# ov ogtvelov arden goyutyun unecox TripleDES i class eric funkcianeric TripleDESCryptoServiceProvider i mej exac

asem vor voch mi dzev chem karum hello ic edi stanam

IV dnum em {0,0,0,0,0,0,0,0} kam ndhnarapes null ECB (electronic code book ) ov porcelu hamar u eli chi kpnum


hetaqrqirn ena vor yete masnatem string 4 hat characterneri (xosqi "hell" u "o" ) apa unicode darcneluc u encode aneluc heto kstanam

amen mi 8 byte anoc bloki hamar( "hello" i u "o" el verjum '0xff' avelacrac) uremn es amen mi 8 byte anoc bloki hamar stanum em 16 byte ardyunq vori arajin 8 byte chisht u chisht hamnknuma henc eeeeeeeeeeeeeeeeeeeeen


c++ ovi ardyunqi het

nd vorum porcum em yev urish input string erov es senca, bayc de ho chem kara ed amen bloki encoded 16 byte ic verji 8 qcem ?


yete nuynisk tenc anem arden DECODE chem kara anem

xorhurd ktaq txeq vonc anem ?

npatak mekna encode anel 3DES ov hello u stanal verevum nshvac Byte array

es 2 ora gluxs urav

hetaqrqirn ena vor yete porcem
__________________
Ախպեր դու էմիգրացիան տուրիզմի հետ մի խառնի...

http://moskull.livejournal.com/
Երեխա is offline   Reply With Quote Quote selected
Old Sep 11, 2008, 15:31   #2
Дошкольник
 
Fox's Avatar
 
Join Date: Nov 2005
Location: AM
Posts: 143
Rep Power: 4
Reputation: 10
Encrypti orinak -
ConvertHexStringToByteArray funkcian petqa grel inqnuruin :-)
kam ogtagorcel standart funkcianer

private string sk = "B51CFD05E333882F1F96F3B0121FDE0FDF9ED5A1B25C8C2D" ;
private string siv = "A29D41CEAE072F6F";
private byte[] k;
private byte[] iv;
k = new byte[sk.Length/2];
iv = new byte[siv.Length/2];

k = ConvertHexStringToByteArray(sk);
iv = ConvertHexStringToByteArray(siv);

byte[] eHello;
SymmetricAlgorithm cp = new TripleDESCryptoServiceProvider();

ICryptoTransform ct;

ct = cp.CreateEncryptor(k, iv);

System.IO.MemoryStream ms = new System.IO.MemoryStream();
CryptoStream cs = new CryptoStream(ms, ct, CryptoStreamMode.Write);

cs.Write(Encoding.UTF8.GetBytes("HELLO"), 0, Encoding.UTF8.GetBytes("HELLO").Length);
cs.FlushFinalBlock();
eHello = new byte[ms.Length];

ms.Seek(0, System.IO.SeekOrigin.Begin);
ms.Read(eHello, 0, eHello.Length);

cs.Close();
ms.Close();


eHello-n klini qo uzac@ :-)

hanelem im ashkhatokh koderic
__________________
Если в слове "жена" сделать 4 ошибки, получится "пиво"

http://www.Explorer.am - Explore Armenia!
Fox is offline   Reply With Quote Quote selected
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 13:38.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
This board was founded on September 29, 2001
Powered by Viper Internet

Affordable Web Hosting | ParevNet

Buy text link