3 Replies - 1831 Views - Last Post: 10 July 2008 - 12:30 AM

#1 yogesh2502  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 09-July 08

Encryption Decryption

Post icon  Posted 09 July 2008 - 11:52 PM

I want to know that how to encrypt the data in the textbox and save it to database
and again decrypt it again when i fetch from database
Is This A Good Question/Topic? 0
  • +

Replies To: Encryption Decryption

#2 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1483
  • View blog
  • Posts: 8,203
  • Joined: 07-September 06

Re: Encryption Decryption

Posted 09 July 2008 - 11:59 PM

Well, this can't actually be done with Javascript, it isn't a server side language.

I would suggest using google to look for an answer, because you have posted no code I will post no code. DIC has a good faith policy, and at this point you haevn't shown good faith.

Also, please use the [code] PASTE YOUR CODE HERE [/code] when posting your code.

This would be done using a function such as the mcrypt and a salt then reversiing the procedure when fetching the data, but PHP, or ASP, or any other server side language is REQUIRED for this to work.
Was This Post Helpful? 0
  • +
  • -

#3 AmitTheInfinity  Icon User is offline

  • C Surfing ∞
  • member icon

Reputation: 119
  • View blog
  • Posts: 1,565
  • Joined: 25-January 07

Re: Encryption Decryption

Posted 10 July 2008 - 12:22 AM

View PostBetaWar, on 10 Jul, 2008 - 12:29 PM, said:

Well, this can't actually be done with Javascript, it isn't a server side language.

I would suggest using google to look for an answer, because you have posted no code I will post no code. DIC has a good faith policy, and at this point you haevn't shown good faith.

Also, please use the [code] PASTE YOUR CODE HERE [/code] when posting your code.

This would be done using a function such as the mcrypt and a salt then reversiing the procedure when fetching the data, but PHP, or ASP, or any other server side language is REQUIRED for this to work.



Well, it is correct that Server side scripting languages like PHP or ASP or JSP [whatever], provides you with the APIs that can help you to encrypt or decrypt the data while storing to database or fetching from it. But I think what this person is asking for is, how to encrypt data before submitting the request to server for storing to database, or vice versa. And in that case, yes encryption or decryption CAN be done in Javascript.

But I think your next point is absolutely correct. yogesh2502, we don't provide you code, show your efforts and earn your help. :)
Was This Post Helpful? 0
  • +
  • -

#4 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1483
  • View blog
  • Posts: 8,203
  • Joined: 07-September 06

Re: Encryption Decryption

Posted 10 July 2008 - 12:30 AM

Quote

But I think what this person is asking for is, how to encrypt data before submitting the request to server for storing to database, or vice versa. And in that case, yes encryption or decryption CAN be done in Javascript.

Okay, I see your point, I was just thinking that they were wanting to have encrypted information in a database, not that they required it to be JS based.

Make sure that you don't attempt to Hash encrypt the data though, I think the browser will force the script to stop before it has brute forced the decryption. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1