1,105,546 Community Members

timestamp based encryption

Member Avatar
csss
Newbie Poster
19 posts since Jan 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

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

Member Avatar
riahc3
 
1,404 posts since May 2008
Reputation Points: 45 [?]
Q&As Helped to Solve: 14 [?]
Skill Endorsements: 18 [?]
Team Colleague
 
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....

Member Avatar
Ketsuekiame
Posting Virtuoso
1,676 posts since May 2010
Reputation Points: 793 [?]
Q&As Helped to Solve: 231 [?]
Skill Endorsements: 27 [?]
 
0
 

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. ^.^

Member Avatar
riahc3
 
1,404 posts since May 2008
Reputation Points: 45 [?]
Q&As Helped to Solve: 14 [?]
Skill Endorsements: 18 [?]
Team Colleague
 
0
 

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.

Member Avatar
csss
Newbie Poster
19 posts since Jan 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

is there any algorithm based on timestamp value?

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

Member Avatar
riahc3
 
1,404 posts since May 2008
Reputation Points: 45 [?]
Q&As Helped to Solve: 14 [?]
Skill Endorsements: 18 [?]
Team Colleague
 
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?

Member Avatar
Ange1ofD4rkness
Posting Whiz
306 posts since May 2010
Reputation Points: 29 [?]
Q&As Helped to Solve: 12 [?]
Skill Endorsements: 7 [?]
 
0
 

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)

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article