We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,248 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

timestamp based encryption

I want to encrypt the data based on user time.
Is there any algorithm based on timestamp value for encryption and decryption?

Pls give some suggestion

4
Contributors
6
Replies
2 Days
Discussion Span
3 Months Ago
Last Updated
33
Views
csss
Newbie Poster
19 posts since Jan 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

http://www.obviex.com/samples/encryptionwithsalt.aspx

And where it says:

Random random = new Random(seed);

Put

Random random = new Random((int)DateTime.Now.Ticks);

Would be, I believe, the timebased encryption you are looking for....

riahc3
 
Team Colleague
1,303 posts since May 2008
Reputation Points: 62
Solved Threads: 13
Skill Endorsements: 11

The problem arises that he also needs to decrypt it with the same key. So unless he transmitted the timestamp across so that the psuedorandom generator could generate the same number, this would not work.
If the timestamp were transmitted, then you've just given away your key...

Also, I have been reliably informed that the encryption method you linked to is flawed and implemented incorrectly after I too, also attempted to use it as a base for my own encryption. I could not tell you why, I'm no security expert. ^.^

Ketsuekiame
Veteran Poster
1,195 posts since May 2010
Reputation Points: 541
Solved Threads: 153
Skill Endorsements: 8

The problem arises that he also needs to decrypt it with the same key. So unless he transmitted the timestamp across so that the psuedorandom generator could generate the same number, this would not work.
If the timestamp were transmitted, then you've just given away your key... Also, I have been reliably informed that the encryption method you linked to is flawed and implemented incorrectly after I too, also attempted to use it as a base for my own encryption. I could not tell you why, I'm no security expert. ^.^

He asked, I answered.

riahc3
 
Team Colleague
1,303 posts since May 2008
Reputation Points: 62
Solved Threads: 13
Skill Endorsements: 11

is there any algorithm based on timestamp value?

can any one please help me to find out the answer.

csss
Newbie Poster
19 posts since Jan 2013
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

is there any algorithm based on timestamp value?

can any one please help me to find out the answer.

Could you be more specific on what exactly you want to do?

riahc3
 
Team Colleague
1,303 posts since May 2008
Reputation Points: 62
Solved Threads: 13
Skill Endorsements: 11

You could use riahc3's comment to generate random numbers and then say apply each number to each character of a message. The problem here is that you key is the time, which is extremely hard to deal with because if you are one second off, the decipher could be ruined.

Now you could use riahc3's comment to create a key, which could then be used to encipher a message. HOWEVER, this means that the key is only good for one message. Meaning if you encipher a new message, you'll need a new key. This also means you have to find a way to give the key to someone else to decipher each message (which is a huge security flaw in so many ways), or if you are storing it on your end, you have to find a way to store these keys and remember which one is for which message (also a security flaw).

You could make one based on time, but it would be a bad idea.

UPDATE: Actually when using the timer, the only way you could really do it is to create a key (which there are encipher/decipher methods out there that just take the message (encrypted or decrypted) and the key and spits out the results)

Ange1ofD4rkness
Posting Whiz in Training
211 posts since May 2010
Reputation Points: 10
Solved Threads: 7
Skill Endorsements: 2

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.2943 seconds using 2.66MB