473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Windows Regitry - Encryption Key storage

We have a public and private key pair for Credit Card data encryption.
The database part is all done where we generated the key pair.

Public key resides in the database for encryption and we intend to store the
private key in the registry of Windows 2003 server from which our
application will pass it to the stored proc to decrypt back the data.

Problem is that when we use the "Multi-String" value in the registry to
store the private key which looks something like

"----- BEGIN KEY
fooo
bar
tar
"

we get the error "Data of type REG_MULTI_SZ cannot contain empty strings,
Registry editor will remove all empty strings found and hence it messes up
the Key format.

Question: How can we store the key in the registry?

Any help is appreciated!

Rgds,
-H
Jul 21 '05 #1
5 2491
Any volunteers?

"Harman Sahni" <Ha*********@Hotmail.com> wrote in message
news:uj**************@TK2MSFTNGP12.phx.gbl...
We have a public and private key pair for Credit Card data encryption.
The database part is all done where we generated the key pair.

Public key resides in the database for encryption and we intend to store the private key in the registry of Windows 2003 server from which our
application will pass it to the stored proc to decrypt back the data.

Problem is that when we use the "Multi-String" value in the registry to
store the private key which looks something like

"----- BEGIN KEY
fooo
bar
tar
"

we get the error "Data of type REG_MULTI_SZ cannot contain empty strings,
Registry editor will remove all empty strings found and hence it messes up
the Key format.

Question: How can we store the key in the registry?

Any help is appreciated!

Rgds,
-H

Jul 21 '05 #2
Hi,

convert the string to byte array and use it. The SetValue method will
create a binary registry key and will store all the data you need.

Then you have to convert it back as well.

Sunny
In article <#2**************@TK2MSFTNGP10.phx.gbl>,
Ha*********@Hotmail.com says...
Any volunteers?

"Harman Sahni" <Ha*********@Hotmail.com> wrote in message
news:uj**************@TK2MSFTNGP12.phx.gbl...
We have a public and private key pair for Credit Card data encryption.
The database part is all done where we generated the key pair.

Public key resides in the database for encryption and we intend to store

the
private key in the registry of Windows 2003 server from which our
application will pass it to the stored proc to decrypt back the data.

Problem is that when we use the "Multi-String" value in the registry to
store the private key which looks something like

"----- BEGIN KEY
fooo
bar
tar
"

we get the error "Data of type REG_MULTI_SZ cannot contain empty strings,
Registry editor will remove all empty strings found and hence it messes up
the Key format.

Question: How can we store the key in the registry?

Any help is appreciated!

Rgds,
-H


Jul 21 '05 #3
Since registry considers long strings as multi strings... "empty strings"
are meant to be spaces, etc between strings.
"Hank Coffin" <Ha********@discussions.microsoft.com> wrote in message
news:CE**********************************@microsof t.com...
How about something quick and dirty like setting the empty string to something like "[X47]" when you write it to the registry and then deleting
it when you are done?
"Harman Sahni" wrote:
Any volunteers?

"Harman Sahni" <Ha*********@Hotmail.com> wrote in message
news:uj**************@TK2MSFTNGP12.phx.gbl...
We have a public and private key pair for Credit Card data encryption.
The database part is all done where we generated the key pair.

Public key resides in the database for encryption and we intend to store
the
private key in the registry of Windows 2003 server from which our
application will pass it to the stored proc to decrypt back the data.

Problem is that when we use the "Multi-String" value in the registry

to store the private key which looks something like

"----- BEGIN KEY
fooo
bar
tar
"

we get the error "Data of type REG_MULTI_SZ cannot contain empty strings, Registry editor will remove all empty strings found and hence it messes up the Key format.

Question: How can we store the key in the registry?

Any help is appreciated!

Rgds,
-H


Jul 21 '05 #4
Yeah I tried converting that into binary data but somehow the exact
indentation and spacing are not retained.

"Sunny" <su******@icebergwireless.com> wrote in message
news:ON**************@TK2MSFTNGP09.phx.gbl...
Hi,

convert the string to byte array and use it. The SetValue method will
create a binary registry key and will store all the data you need.

Then you have to convert it back as well.

Sunny
In article <#2**************@TK2MSFTNGP10.phx.gbl>,
Ha*********@Hotmail.com says...
Any volunteers?

"Harman Sahni" <Ha*********@Hotmail.com> wrote in message
news:uj**************@TK2MSFTNGP12.phx.gbl...
We have a public and private key pair for Credit Card data encryption.
The database part is all done where we generated the key pair.

Public key resides in the database for encryption and we intend to store
the
private key in the registry of Windows 2003 server from which our
application will pass it to the stored proc to decrypt back the data.

Problem is that when we use the "Multi-String" value in the registry

to store the private key which looks something like

"----- BEGIN KEY
fooo
bar
tar
"

we get the error "Data of type REG_MULTI_SZ cannot contain empty strings, Registry editor will remove all empty strings found and hence it messes up the Key format.

Question: How can we store the key in the registry?

Any help is appreciated!

Rgds,
-H


Jul 21 '05 #5
It depends how you convert it. Can you show some code?

Sunny

In article <e2**************@TK2MSFTNGP09.phx.gbl>,
Ha*********@Hotmail.com says...
Yeah I tried converting that into binary data but somehow the exact
indentation and spacing are not retained.

"Sunny" <su******@icebergwireless.com> wrote in message
news:ON**************@TK2MSFTNGP09.phx.gbl...
Hi,

convert the string to byte array and use it. The SetValue method will
create a binary registry key and will store all the data you need.

Then you have to convert it back as well.

Sunny
In article <#2**************@TK2MSFTNGP10.phx.gbl>,
Ha*********@Hotmail.com says...
Any volunteers?

"Harman Sahni" <Ha*********@Hotmail.com> wrote in message
news:uj**************@TK2MSFTNGP12.phx.gbl...
> We have a public and private key pair for Credit Card data encryption.
> The database part is all done where we generated the key pair.
>
> Public key resides in the database for encryption and we intend to store the
> private key in the registry of Windows 2003 server from which our
> application will pass it to the stored proc to decrypt back the data.
>
> Problem is that when we use the "Multi-String" value in the registry to > store the private key which looks something like
>
> "----- BEGIN KEY
> fooo
> bar
> tar
> "
>
> we get the error "Data of type REG_MULTI_SZ cannot contain empty strings, > Registry editor will remove all empty strings found and hence it messes up > the Key format.
>
> Question: How can we store the key in the registry?
>
> Any help is appreciated!
>
> Rgds,
> -H
>
>


Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michael Bourgon | last post by:
I installed Windows 2000 SP4 on my server this evening. We ran into an odd error, and (1) wanted to share, and (2) wanted to see if there were any other things I should be on the lookout for. ...
2
by: gaurav khanna | last post by:
Hi I need to store the credit card information in my database. I have been looking for some third party tools which could provide encryption for credit card numbers. The help I need is: a)...
5
by: Chakkaradeep | last post by:
Hi all, in my service i added my Registry Programming code,am facing with a problem which am not able to rectify it..the problem is , in the service, the program gets hanged and doesnt move...
4
by: PJones | last post by:
I am looking for the best way to one way encrypt a password for storage in a database using (asp.net / vb.net) basically I need some functions or examples that I can freely use in a commercial...
3
by: Anon | last post by:
I made this class to encrypt my DataSet before saving it to disk. So, first in the main program I write the DataSet to XML in a MemoryStream. I pass this stream to the E_File sub, which encrypts...
5
by: Harman Sahni | last post by:
We have a public and private key pair for Credit Card data encryption. The database part is all done where we generated the key pair. Public key resides in the database for encryption and we...
10
by: Smurff | last post by:
Hi, This code works fine on win and linux but not on hpux. All is compiled with gcc. Can anyone help please? /*****************************************************************************/ /*...
7
by: Mark Rae | last post by:
Hi, Picking your collective brains again, this time regarding the storage of the key used in symmetric encryption. Let's say you have a requirement to add encryption to a C# project, so you...
7
by: lucalfiero | last post by:
Hi, is there a way to quickly encrypt the filesystem of an USB storage (FAT)? I searched in sourceforge but seems to there're nothing. Thank you very much Luca
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.