Encrypted password in xml file

how to embed a encrypted password into xml file and retrieve it.I do have the encryption function but once the application is invoked the encrypted password is distored. Any idea how to keep the same..
LVL 3
ajaypappanAsked:
Who is Participating?
 
Rich RumbleSecurity SamuraiCommented:
Is it a standard hash (one way encryption)?
For example: pass1234   equals...
MD5            B4AF804009CB036A4CCDC33431EF9AC9
SHA-1            789B49606C321C8CF228D17942608EFF0CCC4171
SHA-2 (256)      BD94DCDA26FCCB4E68D6A31F9B5AAC0B571AE266D822620E901EF7EBE3A11D4F
SHA-2 (384)      16C8D6427046CB9916A4415FB0402010B812E8B653EEC34FE936925D38C7F1FD24815E7816613F1E83707C8444D0C83A
SHA-2 (512)      B66DD5A7A689F88E302AB2AE4A9567F9C7572C18E520B3BF712BB2630B3931A503D647BAEDF48DF470006312D07984216578B60526E5EE6137EF1FD215190A0C
RIPEMD-160      E312CE59FC849A35E0E56951DF4A66E272251546
NT            8034586795EBAF0427CC3417EBEA341C
MySQLSHA1      34FD07B148CCA9FCB2BE6C2EA20689053E748B13

We will need to know what an example value looks like without the application going, and what it looks like when the app is envoked.
-rich
0
 
GarethMCommented:
Maybe you could store the encrypted value in the XML as a hex representation?

Can you expand a little bit on your question, please, then I may be able to help more.
0
 
ajaypappanAuthor Commented:
Private Const MS_DEF_PROV = "Microsoft Base Cryptographic Provider v1.0"
Private Const PROV_RSA_FULL = 1
Private Const ALG_CLASS_DATA_ENCRYPT = 24576
Private Const ALG_CLASS_HASH = 32768

Private Const ALG_TYPE_ANY = 0
Private Const ALG_TYPE_BLOCK = 1536
Private Const ALG_TYPE_STREAM = 2048

Private Const ALG_SID_RC2 = 2

Private Const ALG_SID_RC4 = 1
Private Const ALG_SID_MD5 = 3
Private Const CALG_MD5 = ((ALG_CLASS_HASH Or ALG_TYPE_ANY) Or ALG_SID_MD5)
Private Const CALG_RC2 = ((ALG_CLASS_DATA_ENCRYPT Or ALG_TYPE_BLOCK) Or ALG_SID_RC2)
Private Const CALG_RC4 = ((ALG_CLASS_DATA_ENCRYPT Or ALG_TYPE_STREAM) Or ALG_SID_RC4)

Private Const ENCRYPT_ALGORITHM = CALG_RC4
Private Const ENCRYPT_BLOCK_SIZE = 1

Private Const CRYPT_EXPORTABLE = 1
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
ajaypappanAuthor Commented:
Rich it looks like the app is using RC4 algorithm
GarethM if its hex how to wrap it up?
0
 
Kelvin_KingCommented:
What is the application doing?

Are you saying that the application is supposed to encrypt a password and store it into an XML file?
0
 
ajaypappanAuthor Commented:
this application uses xml file for grids and when i copy a encrypted passoword to the xml and save it .It should not change the characters.

Now when i reopen the application, and try to rerun the application it crashes at the password, cause the password changed..
No idea y just saving and reopening the opening crashes it..
0
 
Kelvin_KingCommented:
Is it possible that you can post the code for the part of the application that is saving to the XML file?

Most likely it's a formatting issue.
0
 
ajaypapCommented:
please close this question as i found another way to solve the problem, by copying the string in a file and opening the file and reading it from there using file object
0
 
ajaypapCommented:
please refund points too
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.