• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Dependable Javascript Encryption With Java Counterpart

 
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a dependable JavaScript implementation of a symmetric encryption algorithm (password based) that has a counterpart in Java?

What I mean is...if I encrypt some data in JavaScript using DES.encrypt("data to encrypt!!", randomkey)

...will DES.decrypt(data_to_decrypt, randomkey) from JAVA always return the correctly decrypted data (the exact same info that was encrypted in Javascript)?

(yes I know, there is the obvious "why are you designing it like this in the first place" but I am up against some pretty odd and immovable infrastructure/design requirements)
 
Rancher
Posts: 4804
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have never looked, so I can't say with 100% certainty, "yes" but its just programming, I can't see any reason that you can't find or write an implementation of AES-128 for Javascript.

A quick google shows
http://www.hanewin.net/encrypt/aes/aes.htm at the top.

Be careful, AES and most other ciphers work on arrays of unsigned octets, which are close to unsigned byte arrays in most languages, but are very different from Strings in most languages.

But I have to ask, what do you mean by "dependable"?

If you mean algorithmically deterministic, sure, feed the same IV, passkey and clear text, and get the expected ciphertext. Otherwise, you have a bad implementation. That is the definition of a decent implementation.

But if you mean "secure" or even "reasonably secure" when you use the word "dependable" then I'm not at all ready to say "yes"

All ciphers are about protecting data from one trusted store to another across an untrusted space/time.

I'm not sure that a client browser implementing Javascript is worthy of much trust.
 
reply
    Bookmark Topic Watch Topic
  • New Topic