Hashing with js?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • agam
    New Member
    • Jan 2011
    • 21

    #1

    Hashing with js?

    Is there any way to encrypt/hash a string value in JavaScript?
    I know that it is a security concern but I need some way of hiding data in my cookie.
    Just so i'll have a thin layer of protection.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Yes there is. You can implement pretty much any of the popular hash/encryption algorithms in javascript.

    Comment

    • agam
      New Member
      • Jan 2011
      • 21

      #3
      Examples?
      Any simple way?
      Can you give me the theory of doing it?
      Please don't give me js classes or anything made by someone, I want to learn it by myself.

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        Can't give you any examples since that would be like giving you a class.

        The "theory" of encryption is to take data along with a key and perform reversible mathematical operations on the data to obscure the original data.

        A "simple" way of doing it is to substitute one character with another character. But that's not very secure.

        A simple algorithm you may want to look at is the RC4 algorithm. You can read about it here http://en.wikipedia.org/wiki/RC4.

        Comment

        Working...