msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Registry

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB WinAPI
Author Message
OfficeUser



Joined: 02 Feb 2008
Posts: 16

PostPosted: Thu Feb 07, 2008 4:46 am    Post subject: Registry Reply with quote

I want to store a date and two integers in the Registry. Where is a safe
place to store these values where the location would be on any computer? I
would also like to encrypt the values; how can I do that? Then, how do I
compare the current date against the encrypted stored date? Finally, I need
to decrement each integer by 1 for certain conditions then compare the
stored value against 0; how do I do that?

Thanks!

Archived from group: microsoft>public>vb>winapi
Back to top
View user's profile Send private message
MikeD



Joined: 04 Oct 2007
Posts: 3348

PostPosted: Thu Feb 07, 2008 1:14 pm    Post subject: Re: Registry Reply with quote

"OfficeUser" wrote in message @corp.supernews.com...
>I want to store a date and two integers in the Registry. Where is a safe
>place to store these values where the location would be on any computer? I
>would also like to encrypt the values; how can I do that? Then, how do I
>compare the current date against the encrypted stored date? Finally, I need
>to decrement each integer by 1 for certain conditions then compare the
>stored value against 0; how do I do that?


Why the Registry? What is the purpose of this date and 2 integers? People
tend to use the Registry to store data that should not be stored in the
Registry. That's the only reason I'm asking.

As far as the rest of your questions, what have you tried? Did you search
google? If you had, you'd find dozens (or more) encryption routines.

--
Mike
Microsoft MVP Visual Basic
Back to top
View user's profile Send private message
OfficeUser



Joined: 02 Feb 2008
Posts: 16

PostPosted: Thu Feb 07, 2008 3:33 pm    Post subject: Re: Registry Reply with quote

Mike,

Thanks for responding!

This data is for trial version purposes. The date is the installed date. It
needs to be "hidden" so it can not be changed to extend the trial period.
The integers are for number of times opened and number of days in extension
of time. The integers also need to be "hidden" so they can not be changed.


"MikeD" wrote in message @TK2MSFTNGP04.phx.gbl...
>
> "OfficeUser" wrote in message
> @corp.supernews.com...
>>I want to store a date and two integers in the Registry. Where is a safe
>>place to store these values where the location would be on any computer? I
>>would also like to encrypt the values; how can I do that? Then, how do I
>>compare the current date against the encrypted stored date? Finally, I
>>need to decrement each integer by 1 for certain conditions then compare
>>the stored value against 0; how do I do that?
>
>
> Why the Registry? What is the purpose of this date and 2 integers? People
> tend to use the Registry to store data that should not be stored in the
> Registry. That's the only reason I'm asking.
>
> As far as the rest of your questions, what have you tried? Did you search
> google? If you had, you'd find dozens (or more) encryption routines.
>
> --
> Mike
> Microsoft MVP Visual Basic
>
>
Back to top
View user's profile Send private message
OfficeUser



Joined: 02 Feb 2008
Posts: 16

PostPosted: Thu Feb 07, 2008 3:38 pm    Post subject: Re: Registry Reply with quote

The app I am working on is something any user can use in any workbook.
Therefpre, the date and two integers can not be stored in a specific
workbook.

As far as the rest of my questions, if you can give me a generalized answer
to give ne a kickstart, that's all I need to take it from there.


"MikeD" wrote in message @TK2MSFTNGP04.phx.gbl...
>
> "OfficeUser" wrote in message
> @corp.supernews.com...
>>I want to store a date and two integers in the Registry. Where is a safe
>>place to store these values where the location would be on any computer? I
>>would also like to encrypt the values; how can I do that? Then, how do I
>>compare the current date against the encrypted stored date? Finally, I
>>need to decrement each integer by 1 for certain conditions then compare
>>the stored value against 0; how do I do that?
>
>
> Why the Registry? What is the purpose of this date and 2 integers? People
> tend to use the Registry to store data that should not be stored in the
> Registry. That's the only reason I'm asking.
>
> As far as the rest of your questions, what have you tried? Did you search
> google? If you had, you'd find dozens (or more) encryption routines.
>
> --
> Mike
> Microsoft MVP Visual Basic
>
>
Back to top
View user's profile Send private message
mayayana



Joined: 04 Oct 2007
Posts: 734

PostPosted: Thu Feb 07, 2008 3:41 pm    Post subject: Re: Registry Reply with quote

Are you talking about VBA in Office?
If so you should ask your questions in
an Office group.

If you're using VB you can use SaveSetting and
GetSetting. They're built-in VB functions that are very
easy to use, storing your main key under:
HKEY_CURRENT_USER\Software\VB and VBA Program Settings
That should work on any computer, but it's user-specific
and can only save strings.

To encode, one of the easiest methods is to just take
the ASCII values for each character and then jumble them
up. Or you could add nonsense values to your date
numbers.

> I want to store a date and two integers in the Registry. Where is a safe
> place to store these values where the location would be on any computer? I
> would also like to encrypt the values; how can I do that? Then, how do I
> compare the current date against the encrypted stored date? Finally, I
need
> to decrement each integer by 1 for certain conditions then compare the
> stored value against 0; how do I do that?
>
> Thanks!
>
>
Back to top
View user's profile Send private message
Karl E. Peterson



Joined: 04 Oct 2007
Posts: 4836

PostPosted: Thu Feb 07, 2008 3:05 pm    Post subject: Re: Registry Reply with quote

OfficeUser wrote:
> I want to store a date and two integers in the Registry. Where is a safe
> place to store these values where the location would be on any computer? I
> would also like to encrypt the values; how can I do that? Then, how do I
> compare the current date against the encrypted stored date? Finally, I need
> to decrement each integer by 1 for certain conditions then compare the
> stored value against 0; how do I do that?

Registry is a very bad choice for this sort of protection for a number of reasons.
Principle among them is that it's extremely easy to find out what you're doing using
the regmon utility. But with Vista now a sad reality, the other principle reason
would be that all your users would require admin privs for this scheme to work. I'd
suggest you reconsider your needs and/or devise another approach entirely.
--
..NET: It's About Trust!
http://vfred.mvps.org
Back to top
View user's profile Send private message
Mark Yudkin



Joined: 04 Oct 2007
Posts: 198

PostPosted: Sun Feb 10, 2008 2:33 pm    Post subject: Re: Registry Reply with quote

Your schem and use of the registry for this purpose would be the perfect
location to use if you want your users to be able to turn the trial version
into a full version with only around 30" work (on an off day). You need to
seriously rethink your design.
"OfficeUser" wrote in message @corp.supernews.com...
> Mike,
>
> Thanks for responding!
>
> This data is for trial version purposes. The date is the installed date.
> It needs to be "hidden" so it can not be changed to extend the trial
> period. The integers are for number of times opened and number of days in
> extension of time. The integers also need to be "hidden" so they can not
> be changed.
>
>
> "MikeD" wrote in message
> @TK2MSFTNGP04.phx.gbl...
>>
>> "OfficeUser" wrote in message
>> @corp.supernews.com...
>>>I want to store a date and two integers in the Registry. Where is a safe
>>>place to store these values where the location would be on any computer?
>>>I would also like to encrypt the values; how can I do that? Then, how do
>>>I compare the current date against the encrypted stored date? Finally, I
>>>need to decrement each integer by 1 for certain conditions then compare
>>>the stored value against 0; how do I do that?
>>
>>
>> Why the Registry? What is the purpose of this date and 2 integers?
>> People tend to use the Registry to store data that should not be stored
>> in the Registry. That's the only reason I'm asking.
>>
>> As far as the rest of your questions, what have you tried? Did you
>> search google? If you had, you'd find dozens (or more) encryption
>> routines.
>>
>> --
>> Mike
>> Microsoft MVP Visual Basic
>>
>>
>
>
Back to top
View user's profile Send private message
Kevin Provance



Joined: 04 Oct 2007
Posts: 800

PostPosted: Fri Feb 15, 2008 6:15 am    Post subject: Re: Registry Reply with quote

How so? He only wants to place a few obscure keys (if properly names they
won't get attention) to plant the start date, and that's all you really
need. You can count days down (and forward in case the user tries to change
the date) based on that. How would tamptering with that make it a full
version?

Heck, he could even duplicate the process and plant two dates and compare
them in case one is tampered with and remind the user that tampering with
dates will get days taken off the trial for being dishonest.

The full vs trial version comes at the entering of a registration number
based on some unchanging criteria. The registry works great for that, and
I've been doing it for 12 years.

If you have a better way, fess up!

"Mark Yudkin" wrote in message
news:%23p08w97aIHA.4684@TK2MSFTNGP06.phx.gbl...
| Your schem and use of the registry for this purpose would be the perfect
| location to use if you want your users to be able to turn the trial
version
| into a full version with only around 30" work (on an off day). You need to
| seriously rethink your design.
| "OfficeUser" wrote in message
| @corp.supernews.com...
| > Mike,
| >
| > Thanks for responding!
| >
| > This data is for trial version purposes. The date is the installed date.
| > It needs to be "hidden" so it can not be changed to extend the trial
| > period. The integers are for number of times opened and number of days
in
| > extension of time. The integers also need to be "hidden" so they can not
| > be changed.
| >
| >
| > "MikeD" wrote in message
| > @TK2MSFTNGP04.phx.gbl...
| >>
| >> "OfficeUser" wrote in message
| >> @corp.supernews.com...
| >>>I want to store a date and two integers in the Registry. Where is a
safe
| >>>place to store these values where the location would be on any
computer?
| >>>I would also like to encrypt the values; how can I do that? Then, how
do
| >>>I compare the current date against the encrypted stored date? Finally,
I
| >>>need to decrement each integer by 1 for certain conditions then compare
| >>>the stored value against 0; how do I do that?
| >>
| >>
| >> Why the Registry? What is the purpose of this date and 2 integers?
| >> People tend to use the Registry to store data that should not be stored
| >> in the Registry. That's the only reason I'm asking.
| >>
| >> As far as the rest of your questions, what have you tried? Did you
| >> search google? If you had, you'd find dozens (or more) encryption
| >> routines.
| >>
| >> --
| >> Mike
| >> Microsoft MVP Visual Basic
| >>
| >>
| >
| >
|
|

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    msvisual.com Forum Index -> VB WinAPI All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group