Examples
Here are some Examples how you can use jCryption.
Please look at the FAQ or documentation page for more detailed information.
You can download alle examples in the jCryption package.
Simple demo »
This is the standard setup.
You have to adjust nothing if you have a normal HTML form.
Just call jCryption on your form.
$("#normal").jCryption();
Submit event demo »
If you dont have a “normal” input type=”submit” button, you can select any DOM element with a jQuery selector.
You can even change the event which triggers the form submit.
In this example the form will be submited if you double click the submit link.
$("#noSubmitbutton").jCryption({ submitTrigger:"#submitButton", submitEvent:"dblclick" });
Callback demo »
Almost everything that jCryption does has a callback function so you always know the current state.
Most of the callback functions also have the possibility to interrupt the encryption process, for example if you want to check the values and if the input was wrong just return false and the execution will be interrupted.
You can even adjust the speed of the calculations (not recommended because I think it should be as fast as possible).
I set the speed in this example to 300ms that you can see every callback in detail.
I also added a statusbox to display the state.
var $status = $(' <div id="status" style="margin-top:15px;"><img style="margin-right:15px;" title="Loading..." src="loading.gif" alt="Loading..." /></div> ').hide(); var $statusText = $status.find("span"); $("#status_container").append($status); $("#callbackForm").jCryption({ collectionSpeed:300, encryptionSpeed:300, beforeEncryption:function() { $statusText.text("Loading Keys ...").parent().show(); return true; }, inputCollectorCallback:function(counter,objectLength) { $statusText.text("Collecting Input: "+(counter+1)+" of "+objectLength); }, encryptionCallback:function(counter,objectLength) { $statusText.text("Encrypting Status: "+Math.round((counter/objectLength)*100)+"%"); }, encryptionFinished:function(encryptedString, objectLength) { $statusText.text("Encrypting Status: Completed! submitting Form"); return true; } });
Full featured demo »
This example shows what jCryption is capable of.
It also includes a way to implement serverside validation with full protection.















February 2nd, 2010
Hi, I tried this java version.
It is working well.
But when i enter a user id of length more than 49, then the password value becomes null & the user id is showing only a 49 length value.
How to solve this?
January 20th, 2010
Hello amr gawish,
Can u pl provide the java implimentation for the same.
January 20th, 2010
Check this
http://www.michalfranc.com/articles/jcryption.html
November 22nd, 2009
The big problem of jCryption is that it want to do everything himself : to get encryption keys, it must be with an ajax request and JSON result, it cannot be a user function. The same thing for encrypted result: some users may want to get the result without sending the form.
That’s why a extremly modify the jCryption’s architecture in my project which is using it.
However, jCryption is an extremly interresting library and can help everybody to secure some data.
November 13th, 2009
Can i use this library to encrypt any custom string ???
Some method like
var encryptedString = jcryption.encrypt(”custom”);
????
It would be really helpful if any one provides me with such a solution ???
December 27th, 2009
You can see jCryption2 at http://www.d-sites.com/projets/jcryption2/ which is not the version 2 of jCryption but is more complex and allow to do something with the encrypted string.
November 2nd, 2009
I have working java (JDK1.4) implementation if anyone is interested.
November 9th, 2009
Hi Frac,
Can you provide me java version of backend
Thanks
Ashwin
December 18th, 2009
Hi Frc,
Could you provide me the Java implementation?
Thanks,
FX
December 21st, 2009
Check this
http://www.michalfranc.com/articles/jcryption.html
October 30th, 2009
I have determined, that the XML request for the keys slows down everything a lot. Maybe the keys should be generated by JavaScript when encrypting and PHP when decrypting. I believe this would dramatically speed it up.
Unless the reason that PHP does it is because JavaScript can’t do it. If this is the case, maybe you could modify jCryption so it can.
November 2nd, 2009
Sorry this isn’t possible because with this request the keys are generated on the server.
Theoretically it is possible to eliminate this request but this would increase page load times because the keys must be written to javascript in advance.
I am working on an alternative to deliver precalculated prime arrays so key generation will be much faster.
October 28th, 2009
nice one
October 22nd, 2009
Very nice! One thing that I’m trying to solve is that it not work with this submit code:
but works with this:
October 22nd, 2009
it seems that I cannot post html code here.
it not work with this submit code:
input type=”submit” name=”submit” id=”submit” value=”"
but works with this:
input type=”submit” name=”submitButton” value=”"
October 22nd, 2009
Sorry my bad, I had two of these elements… but the strange thing is that it stucks on “Encrypting Status: Completed! submitting Form” on my case…
October 12th, 2009
WOW!!!! Very Very Very Helpful Topics. I like it and i will also use this
Thanks
Mehedi Hasan
October 3rd, 2009
Thanks !
You can replace split function (depreciated from the version 5.3.0) on line 590 in the php file by explode…
September 18th, 2009
That’s a great security library.
August 16th, 2009
Thank you!
August 15th, 2009
Really Good
August 15th, 2009
that’s really nice… thank you.
August 11th, 2009
Thanks about this program
usefull Library
some trouble about public-key algorithm of RSA
How can I change some key for make the Encryption by myself?
Do not understand about RSA
Thanks again.
August 11th, 2009
Good library. I will try as soon.
August 10th, 2009
I’m almost finished the Java Library, remaining some bugs here and there, and Oh I found a bug in your js, you declared main.php hard coded in the JS, I changed it in my JS to take it from the action attribute.
August 10th, 2009
You can change the URL where you want to receive the keys … look in the documentation under the option “getKeysURL”.
$(”#normal”).jCryption({
getKeysURL:”yourdomain.com/getkeys”
});
Now the keys will be requested from “yourdomain.com/getkeys”. The action of the form is used to submit the form.
August 10th, 2009
hot stuff
August 9th, 2009
That’s a great Library, I’m currently making it possible for Java instead of PHP.
Thanks again.
August 9th, 2009
That’s a great idea, please contact me when you are finshed.
We can add it to the library if you want.
July 27th, 2009
nice 1