EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Crypting password

Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.
#2228
Posted: 02/12/2007 04:10:22
by Josef Novak (Basic support level)
Joined: 08/30/2006
Posts: 47

Hello,

please would you know some simple method how to crypt/decrypt a short text information like password to store it in xml ?

Thanks
#2229
Posted: 02/12/2007 04:13:11
by Eugene Mayevski (EldoS Corp.)

Use TElSymmetricCrypto. Unfortunately there are no samples available at the moment.


Sincerely yours
Eugene Mayevski
#2231
Posted: 02/12/2007 05:05:51
by Josef Novak (Basic support level)
Joined: 08/30/2006
Posts: 47

My experiment:

SBSymmetricCrypto.TElRC2SymmetricCrypto cryptObj = new SBSymmetricCrypto.TElRC2SymmetricCrypto();

SBSymmetricCrypto.TElSymmetricKeyMaterial km = new SBSymmetricCrypto.TElSymmetricKeyMaterial();
km.GenerateIV(32);
km.Generate(32);

cryptObj.KeyMaterial = km; // here it crashes "Invalid key material"

Please do you know why the km.Valid property is false (what probably causes the crash) ? Or what to do better ?

Thx
#2232
Posted: 02/12/2007 05:09:15
by Josef Novak (Basic support level)
Joined: 08/30/2006
Posts: 47

when I removed line
km.GenerateIV(32);

it helped.
So ok, no problem at the moment ... thx
#2234
Posted: 02/12/2007 05:27:56
by Josef Novak (Basic support level)
Joined: 08/30/2006
Posts: 47

Another problem:

string text = "something to Encrypt";
byte[] textB = SBUtils.Unit.BytesOfString(text);

SBSymmetricCrypto.TElRC2SymmetricCrypto cryptObj = new SBSymmetricCrypto.TElRC2SymmetricCrypto();

string key = "abcd";
byte[] keyB = SBUtils.Unit.BytesOfString(key);

SBSymmetricCrypto.TElSymmetricKeyMaterial km = new SBSymmetricCrypto.TElSymmetricKeyMaterial();
km.Key = keyB;

cryptObj.KeyMaterial = km;

byte[] outB = new byte[100];
int outSize = 100;
cryptObj.Encrypt(textB, 0, textB.Length, ref outB, 0, ref outSize);

on the last line I get: Attempted to divide by zero.
I am using Win XP, VS2003, SBB 4.4.0.94.
Please would you advice me where is the problem ?
#2297
Posted: 02/14/2007 03:38:25
by Josef Novak (Basic support level)
Joined: 08/30/2006
Posts: 47

I created my own simple SymmetricCrypto class. Not good, but working.
Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.

Reply

Statistics

Topic viewed 2590 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!