-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About demo #8
Comments
The javascript is inlined and unobfuscated, so it should be relatively easy to create your own version of the site. JS function to validate input before sending the POST request via an HTML form submission: function alg_updated() {
var value = $("#steg_method").val();
$("#arithmetic_param").css("display", "none");
$("#huffman_param").css("display", "none");
$("#bins_param").css("display", "none");
$("#"+value+"_param").css("display", "table-row");
}
function validate_options(src) {
var steg_method = $("#steg_method").val();
if (steg_method == 'arithmetic') {
var x = $("#temp").val();
if (isNaN(x)) {
alert('Temperature not a number');
return false;
}
if (x < 0.5 || x > 1.3) {
alert('Temperature must be within [0.5, 1.3]');
return false;
}
}
var context_len = $("#context").val().length;
if (context_len > 800) {
alert("Context length too long, > 800 characters");
return false;
}
if (src == 'enc') {
var message_len = $("#message_text").val().length;
if (message_len > 800) {
alert("Message text too long, > 800 characters");
return false;
}
} else if (src == 'dec') {
var cover_len = $("#cover_text").val().length;
if (cover_len > 5000) {
alert("Cover text too long, > 5000 characters");
return false;
}
}
$("#submit").prop("disabled", true)
$("#submit").val("Please Wait...")
return true;
} Example POST request URL parameters to the /encrypt endpoint:
Though I'd recommend using JSON and the Fetch API instead of a traditional HTML form submission. Edit: And as for replicating the web server, your best bet would be to use run_single.py as a reference to implement your own encrypt and decrypt functions, and run them as a shell command in your web backend of choice. |
Would you please share the html JS and py file of the online demo? Thank you very much.
The text was updated successfully, but these errors were encountered: