Skip to content
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

Somac #163

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Somac #163

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ font-size: 30px;
margin-top: 2px;
}

//To move navigation buttons outside use these settings:
/To move navigation buttons outside use these settings:

#owl-demo .owl-controls .owl-buttons div, #owl-partner-institutions .owl-controls .owl-buttons div{
position: absolute;
Expand Down
9 changes: 5 additions & 4 deletions css/style1.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Description: The theme to accompany the profile site for vlabs.ac.in
Version: 1.0
*/
@import url(http://fonts.googleapis.com/css?family=Open+Sans:300);
/

/*
try to alter with above URL and check which fit the best
@import url(http://fonts.googleapis.com/css?family=Open+Sans);
Expand Down Expand Up @@ -575,7 +575,7 @@ a:focus
margin-top: 2px;
}

//To move navigation buttons outside use these settings:
/To move navigation buttons outside use these settings:

#owl-demo .owl-controls .owl-buttons div, #owl-partner-institutions .owl-controls .owl-buttons div{
position: absolute;
Expand Down Expand Up @@ -737,8 +737,9 @@ a:focus
<<<<<<< HEAD
font-size: 2.0em;
text-align: left;
=======
font-size: 1.2em;
}
======= {
font-size: 1.2em;
>>>>>>> f3b4f22ca1ec6639cf95185650d5427a8bca30ee
line-height: normal;
color: black;
Expand Down
20 changes: 10 additions & 10 deletions src/lab/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ body
{
margin:0 auto;
padding:0
width:100%;
width:100px;
}

#lab-header, #experiment-header
Expand Down Expand Up @@ -229,25 +229,25 @@ nav#lab-article-navigation ul li a:focus, nav#experiment-article-navigation ul l
color: #fef4e9;
border: solid 1px #da7c0c;
background: #f78d1d;
background: -webkit-gradient(linear, left top, left bottom,
from(#faa51a), to(#f47a20));
background: -moz-linear-gradient(top, #faa51a, #f47a20);
background: -webkit-linear-gradient(top, #faa51a 0%, #f47a20 100%);
background: -o-linear-gradient(top, #faa51a 0%, #f47a20 100%);

}
.button:hover
{
background: #f47c20;
background: -webkit-gradient(linear, left top, left bottom,
from(#f88e11), to(#f06015));
background: -moz-linear-gradient(top, #f88e11, #f06015);
background: -webkit-linear-gradient(top, #f88e11 0%,#f06015 100%);

background: -o-linear-gradient(top, #f88e11 0%, #f06015 100%);

}

.button:active
{
background: -webkit-gradient(linear, left top, left bottom,
from(#f47a20), to(#faa51a));
background: -moz-linear-gradient(top, #f47a20, #faa51a);
background: -webkit-linear-gradient(top, #f47a20 0%, #faa51a 100%);

background: -o-linear-gradient(top, #f47a20 0%, #faa51a 100%);
}

/* basic styles for button size, padding, etc. */
Expand Down
26 changes: 13 additions & 13 deletions src/lab/exp11/Quizzes.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>

Expand Down Expand Up @@ -110,26 +110,26 @@ <h1 class="text-h2-lightblue">Digital Signatures Scheme</h1><div class="content"
</li>
<li>Digital signature uses ______ for generating valid signature
<ol class="d">
<li>Private key </li>
<li>Public key</li>
<li>Secret key</li>
<li>None of the aboove</li>
<li><input name="quest_645" type="radio" value="Private key "/>Private key </li>
<li><input name="quest_645" type="radio" value="Private key"/>Private key</li>
<li><input name="quest_645" type="radio" value="Secret key"/>Secret key</li>
<li><input name="quest_645" type="radio" value="None of the above"/>None of the above</li>
</ol>
</li>
<li>Verification Algorithm uses ______ for validating digital signature
<ol class="d">
<li>Private key </li>
<li>Public key</li>
<li>Secret key</li>
<li>None of the aboove</li>
<li><input name="quest_646" type="radio" value="Private key "/>Private key </li>
<li><input name="quest_646" type="radio" value="Private key"/>Private key</li>
<li><input name="quest_646" type="radio" value="Secret key"/>Secret key</li>
<li><input name="quest_646" type="radio" value="None of the above"/>None of the above</li>
</ol>
</li>
<li>Is digital signature scheme possible without public key cryptography
<ol type="d">
<li>Yes </li>
<li>No</li>
<li>May be exist </li>
<li>None of the aboove</li>
<li><input name="quest_647" type="radio" value="Yes "/>Yes </li>
<li><input name="quest_647" type="radio" value="No"/>No</li>
<li><input name="quest_647" type="radio" value="May be exist "/>May be exist </li>
<li><input name="quest_647" type="radio" value="None of the above"/>None of the above</li>
</ol>
</li>
<li>
Expand Down
5 changes: 4 additions & 1 deletion src/lab/js/cbc-mac.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function isUnsignedInteger(s) {
}

function rand_sequence(len){
ret="";
var ret="";
for(i=0; i<len; i++) {
ret += (Math.ceil(Math.random()*1000000))%2;
}
Expand Down Expand Up @@ -92,6 +92,9 @@ function next_IV() {
var text_size = document.getElementById("plaintext").value.length;
if (text_size > 2*l) {
current_l = l;
function next_function(new) //any local variable 'new' is created
{
}
current_function = next_function(l);
} else {
alert("l should not be greater than the (length of plaintext)/2");
Expand Down
2 changes: 1 addition & 1 deletion src/lab/js/des.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ function des_round( L, R, KeyR )

// copy the existing L bits, then set new L = old R
var temp_L = new Array( 33 );
for( i=0; i<33; i++ )
for( var i=0; i<33; i++ )
{
// copy exising L bits
temp_L[i] = L[i];
Expand Down
6 changes: 3 additions & 3 deletions src/lab/js/exp1.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ function Shift_Encrypt(src, dst) {
var plaintext = document.getElementById(src).value.toLowerCase();
if(plaintext.length < 1){ alert("please enter some plaintext"); return; }
var shift = parseInt(document.getElementById("shift_key").value);
ciphertext = ""; var re = /[a-z]/;
for(i=0; i<plaintext.length; i++){
var ciphertext = ""; var re = /[a-z]/;
for(var i=0; i<plaintext.length; i++){
if(re.test(plaintext.charAt(i))) ciphertext += String.fromCharCode((plaintext.charCodeAt(i) - 97 + shift)%26 + 97);
else ciphertext += plaintext.charAt(i);
}
Expand All @@ -21,7 +21,7 @@ function Shift_Decrypt(src,dest) {
// do some error checking
if(ciphertext.length < 1){ alert("please enter some ciphertext (letters only)"); return; }
var shift = parseInt(document.getElementById("shift_key").value);
plaintext = ""; var re = /[a-z]/;
var plaintext = ""; var re = /[a-z]/;
for(i=0; i<ciphertext.length; i++){
if(re.test(ciphertext.charAt(i))) plaintext += String.fromCharCode((ciphertext.charCodeAt(i) - 97 + 26 - shift)%26 + 97);
else plaintext += ciphertext.charAt(i);
Expand Down
2 changes: 1 addition & 1 deletion src/lab/js/exp10/base64.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function b64tohex(s) {
v = b64map.indexOf(s.charAt(i));
if(v < 0) continue;
if(k == 0) {
ret += int2char(v >> 2);
ret += var int2char(v >> 2);
slop = v & 3;
k = 1;
}
Expand Down
2 changes: 2 additions & 0 deletions src/lab/js/exp10/jsbn2.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ function bnpFromNumber(a,b,c) {
else {
this.fromNumber(a,c);
if(!this.testBit(a-1)) // force MSB set
{ var op_or;
this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
}
if(this.isEven()) this.dAddOffset(1,0); // force odd
while(!this.isProbablePrime(b)) {
this.dAddOffset(2,0);
Expand Down
2 changes: 1 addition & 1 deletion src/lab/js/exp10/rsa2.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function RSASetPrivateEx(N,E,D,P,Q,DP,DQ,C) {

// Generate a new random private key B bits long, using public expt E
function RSAGenerate(B,E) {
var rng = new SecureRandom();
var rng = new var SecureRandom();
var qs = B>>1;
this.e = parseInt(E,16);
var ee = new BigInteger(E,16);
Expand Down
3 changes: 2 additions & 1 deletion src/lab/js/exp11/jsbn2.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ function bnpFromNumber(a,b,c) {
else {
this.fromNumber(a,c);
if(!this.testBit(a-1)) // force MSB set
this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
{ var op_or;
this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);}
if(this.isEven()) this.dAddOffset(1,0); // force odd
while(!this.isProbablePrime(b)) {
this.dAddOffset(2,0);
Expand Down
2 changes: 1 addition & 1 deletion src/lab/js/exp11/rsa.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// convert a (hex) string to a bignum object
function parseBigInt(str,r) {
return new BigInteger(str,r);
return new var BigInteger(str,r);
}

function linebrk(s,n) {
Expand Down
65 changes: 64 additions & 1 deletion src/lab/js/exp11/sha1.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,50 @@ var b64pad_sha1 = ""; /* base-64 pad character. "=" for strict RFC compliance
* These are the functions you'll usually want to call
* They take string arguments and return either hex or base-64 encoded strings
*/
function str2rstr_utf8(new2)
{

}
function rstr_sha1(new1)
{
new1();
}
function rstr2hex(new)
{
new();
}
function rstr2b64(newp)
{
newp();
}
function rstr2any(newl,k)
{
newl();
}


function rstr_hmac_sha1(newj1,newk1)
{
newj1();
newk1();
}

function rstr2hex(newj9,newk9)
{
newj9();
newk9();
}
function rstr2b64(newj7,newk7)
{
newj7();
newk7();
}
function rstr2any(newj6,newk6)
{
newj6();
newk6();
}

function hex_sha1(s) { return rstr2hex(rstr_sha1(str2rstr_utf8(s))); }
function b64_sha1(s) { return rstr2b64(rstr_sha1(str2rstr_utf8(s))); }
function any_sha1(s, e) { return rstr2any(rstr_sha1(str2rstr_utf8(s)), e); }
Expand All @@ -39,6 +83,17 @@ function sha1_vm_test()
/*
* Calculate the SHA1 of a raw string
*/
function rstr2binb(l)
{
}
function binb_sha1(new1,k)
{
new1();
}
function binb2rstr(new)
{
new();
}
function rstr_sha1(s)
{
return binb2rstr(binb_sha1(rstr2binb(s), s.length * 8));
Expand All @@ -48,7 +103,9 @@ function rstr_sha1(s)
* Calculate the HMAC-SHA1 of a key and some data (raw strings)
*/
function rstr_hmac_sha1(key, data)
{function rstr2binb(j)
{
}
var bkey = rstr2binb(key);
if(bkey.length > 16) bkey = binb_sha1(bkey, key.length * 8);

Expand All @@ -58,7 +115,13 @@ function rstr_hmac_sha1(key, data)
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}

function binb_sha1(k,m)
{
}
function binb2rstr(new)
{
new();
}
var hash = binb_sha1(ipad.concat(rstr2binb(data)), 512 + data.length * 8);
return binb2rstr(binb_sha1(opad.concat(hash), 512 + 160));
}
Expand Down
16 changes: 9 additions & 7 deletions src/lab/js/exp2.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ function Mono_Encrypt() {
if(plaintext.length < 1){ alert("please enter some plaintext (letters and numbers only)"); return; }
if(key.length != 26){ alert("key must be 26 characters in length"); return; }
ciphertext = ""; var re = /[a-z]/;
for(i=0; i<plaintext.length; i++){
for(var i=0; i<plaintext.length; i++){
if(re.test(plaintext.charAt(i))) ciphertext += key.charAt(plaintext.charCodeAt(i)-97);
else ciphertext += plaintext.charAt(i);
}
if(document.getElementById("punc").checked)
document.getElementById("c").value = ciphertext.replace(/[^a-z]/g,"").replace(/([a-z]{5})/g,"$1 ");
else
document.getElementById("c").value = ciphertext;
document.getElementById("c").value = var ciphertext;
}

function Mono_Decrypt(f){
ciphertext = document.getElementById("c").value.toLowerCase();
var ciphertext = document.getElementById("c").value.toLowerCase();
key = document.getElementById("key").value.toLowerCase().replace(/[^a-z]/g, "");
if(ciphertext.length < 1){ alert("please enter some ciphertext (letters only)"); return; }
if(key.length != 26){ alert("key must be 26 characters in length"); return; }
Expand Down Expand Up @@ -52,13 +52,15 @@ function Next_Mono_Test() {
}

function CalculateFreq() {
var cipherText = document.getElementById("textarea").value.toLowerCase();
var freq = new Array(26);
var cipherText = document.getElementById("textarea").value.toLowerCase();
var freq = new Array(26);

for (var i=0; i<26; i++) {
freq[i] = 0;
var freq[]=new Array(26);//initialisation
freq[i] = 0;
}
var astring = "a";
var charValOfA = astring.charCodeAt(0);
var charValOfA = astring.charCodeAt(0);
for (var i=0; i<cipherText.length; i++) {
var index = cipherText.charCodeAt(i)-charValOfA;
if(index>=0 && index <= 26) {
Expand Down
4 changes: 2 additions & 2 deletions src/lab/js/exp6/base64.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function b64tohex(s) {
var slop;
for(i = 0; i < s.length; ++i) {
if(s.charAt(i) == b64pad) break;
v = b64map.indexOf(s.charAt(i));
var v = b64map.indexOf(s.charAt(i));
if(v < 0) continue;
if(k == 0) {
ret += int2char(v >> 2);
Expand All @@ -54,7 +54,7 @@ function b64tohex(s) {
}
}
if(k == 1)
ret += int2char(slop << 2);
ret += var int2char(slop << 2);
return ret;
}

Expand Down
2 changes: 1 addition & 1 deletion src/lab/js/exp6/jsbn.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function bnpFromInt(x) {
this.t = 1;
this.s = (x<0)?-1:0;
if(x > 0) this[0] = x;
else if(x < -1) this[0] = x+DV;
else if(x < -1) this[0] = x+ var DV;
else this.t = 0;
}

Expand Down
3 changes: 2 additions & 1 deletion src/lab/js/exp6/jsbn2.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ function bnpFromNumber(a,b,c) {
else {
this.fromNumber(a,c);
if(!this.testBit(a-1)) // force MSB set
this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
{var op_or;
this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);}
if(this.isEven()) this.dAddOffset(1,0); // force odd
while(!this.isProbablePrime(b)) {
this.dAddOffset(2,0);
Expand Down
Loading