diff --git a/mifosng-data/src/main/java/org/mifosng/data/AuthenticatedUserData.java b/mifosng-data/src/main/java/org/mifosng/data/AuthenticatedUserData.java index 74a4b7378..021d531fd 100644 --- a/mifosng-data/src/main/java/org/mifosng/data/AuthenticatedUserData.java +++ b/mifosng-data/src/main/java/org/mifosng/data/AuthenticatedUserData.java @@ -9,6 +9,7 @@ import javax.xml.bind.annotation.XmlRootElement; public class AuthenticatedUserData { private String username; + private boolean authenticated = false; private Collection permissions = new ArrayList(); protected AuthenticatedUserData() { @@ -34,4 +35,12 @@ public class AuthenticatedUserData { public void setUsername(String username) { this.username = username; } + + public boolean isAuthenticated() { + return authenticated; + } + + public void setAuthenticated(boolean authenticated) { + this.authenticated = authenticated; + } } \ No newline at end of file diff --git a/mifosng-individual-lending-app/build.gradle b/mifosng-individual-lending-app/build.gradle index 76b1239d1..28931c908 100644 --- a/mifosng-individual-lending-app/build.gradle +++ b/mifosng-individual-lending-app/build.gradle @@ -44,6 +44,13 @@ repositories { } } +configurations { + providedCompile + compile + runtime + all*.exclude group: 'commons-logging' // this is where we exclude +} + dependencies { def tomcatVersion = '7.0.26' @@ -73,13 +80,12 @@ dependencies { [group: 'javax.validation', name: 'validation-api', version: '1.0.0.GA'], [group: 'org.hibernate', name: 'hibernate-validator', version: hibernateValidatorVersion], [group: 'javax.ws.rs', name: 'jsr311-api', version: '1.1.1'], - [group: 'com.sun.jersey', name: 'jersey-core', version: jerseyVersion], - [group: 'com.sun.jersey', name: 'jersey-client', version: jerseyVersion], [group: 'org.codehaus.jackson', name: 'jackson-mapper-asl', version: '1.9.4'], [group: 'joda-time', name: 'joda-time', version: '2.1'], [group: 'commons-lang', name: 'commons-lang', version: '2.4'], [group: 'commons-io', name: 'commons-io', version: '1.4'], + [group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'], [group: 'org.slf4j', name: 'slf4j-api', version: '1.6.4'], [group: 'org.slf4j', name: 'jcl-over-slf4j', version: '1.6.4'], diff --git a/mifosng-individual-lending-app/src/main/java/org/mifosng/ui/infrastructure/ApiDelegatingAuthenticationProvider.java b/mifosng-individual-lending-app/src/main/java/org/mifosng/ui/infrastructure/ApiDelegatingAuthenticationProvider.java new file mode 100644 index 000000000..0a1488cc0 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/java/org/mifosng/ui/infrastructure/ApiDelegatingAuthenticationProvider.java @@ -0,0 +1,66 @@ +package org.mifosng.ui.infrastructure; + +import java.net.URI; +import java.util.ArrayList; +import java.util.Collection; + +import org.mifosng.data.AuthenticatedUserData; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.ResponseEntity; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider; +import org.springframework.security.core.AuthenticationException; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.User; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.web.client.RestTemplate; + +/** + * A {@link AbstractUserDetailsAuthenticationProvider} which is responsible for delegating authentication to the mifos platform API. + */ +public class ApiDelegatingAuthenticationProvider extends AbstractUserDetailsAuthenticationProvider { + + private final RestTemplate restTemplate; + + @Autowired + public ApiDelegatingAuthenticationProvider(final RestTemplate restTemplate) { + this.restTemplate = restTemplate; + } + + @Override + protected void additionalAuthenticationChecks(UserDetails userDetails, UsernamePasswordAuthenticationToken authentication) throws AuthenticationException { + } + + @Override + protected UserDetails retrieveUser(String username, UsernamePasswordAuthenticationToken authentication) throws AuthenticationException { + + String password = (String) authentication.getCredentials(); + + URI restUri = URI.create("http://localhost:8080/mifosng-provider/api/v1/authentication?username=" + username + "&password=" + password); + ResponseEntity s = this.restTemplate.postForEntity(restUri, authRequest(), AuthenticatedUserData.class); + + UserDetails userDetails = null; + AuthenticatedUserData authenticatedUserData = s.getBody(); + if (authenticatedUserData.isAuthenticated()) { + + Collection authorities = new ArrayList(); + for (String permission : authenticatedUserData.getPermissions()) { + authorities.add(new SimpleGrantedAuthority(permission)); + } + userDetails = new User(authenticatedUserData.getUsername(), "[not needed]", authorities); + } + + return userDetails; + } + + private HttpEntity authRequest() { + HttpHeaders requestHeaders = new HttpHeaders(); + requestHeaders.set("Accept", "application/xml"); + requestHeaders.set("Content-Type", "application/xml"); + + HttpEntity requestEntity = new HttpEntity(requestHeaders); + return requestEntity; + } +} diff --git a/mifosng-individual-lending-app/src/main/resources/META-INF/spring/appContext.xml b/mifosng-individual-lending-app/src/main/resources/META-INF/spring/appContext.xml index eb3cf6912..25f2fa460 100644 --- a/mifosng-individual-lending-app/src/main/resources/META-INF/spring/appContext.xml +++ b/mifosng-individual-lending-app/src/main/resources/META-INF/spring/appContext.xml @@ -12,9 +12,11 @@ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> - + + + \ No newline at end of file diff --git a/mifosng-individual-lending-app/src/main/resources/META-INF/spring/securityContext.xml b/mifosng-individual-lending-app/src/main/resources/META-INF/spring/securityContext.xml index 88298afb5..ab4fe46f5 100644 --- a/mifosng-individual-lending-app/src/main/resources/META-INF/spring/securityContext.xml +++ b/mifosng-individual-lending-app/src/main/resources/META-INF/spring/securityContext.xml @@ -1,127 +1,36 @@ - + - - - - + - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/aes-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/aes-min.js new file mode 100644 index 000000000..4a33a39d2 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/aes-min.js @@ -0,0 +1,10 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function(){var r=CryptoJS,u=r.lib.BlockCipher,o=r.algo,g=[],v=[],w=[],x=[],y=[],z=[],p=[],q=[],s=[],t=[];(function(){for(var b=[],c=0;256>c;c++)b[c]=128>c?c<<1:c<<1^283;for(var a=0,f=0,c=0;256>c;c++){var d=f^f<<1^f<<2^f<<3^f<<4,d=d>>>8^d&255^99;g[a]=d;v[d]=a;var e=b[a],A=b[e],h=b[A],i=257*b[d]^16843008*d;w[a]=i<<24|i>>>8;x[a]=i<<16|i>>>16;y[a]=i<<8|i>>>24;z[a]=i;i=16843009*h^65537*A^257*e^16843008*a;p[d]=i<<24|i>>>8;q[d]=i<<16|i>>>16;s[d]=i<<8|i>>>24;t[d]=i;a?(a=e^b[b[b[h^e]]],f^=b[b[f]]):a=f=1}})(); +var B=[0,1,2,4,8,16,32,64,128,27,54],o=o.AES=u.extend({_doReset:function(){for(var b=this._key,c=b.words,a=b.sigBytes/4,b=4*((this._nRounds=a+6)+1),f=this._keySchedule=[],d=0;d>>24]<<24|g[e>>>16&255]<<16|g[e>>>8&255]<<8|g[e&255]):(e=e<<8|e>>>24,e=g[e>>>24]<<24|g[e>>>16&255]<<16|g[e>>>8&255]<<8|g[e&255],e^=B[d/a|0]<<24);f[d]=f[d-a]^e}c=this._invKeySchedule=[];for(a=0;aa||4>=d?e:p[g[e>>>24]]^q[g[e>>> +16&255]]^s[g[e>>>8&255]]^t[g[e&255]]},encryptBlock:function(b,c){this._doCryptBlock(b,c,this._keySchedule,w,x,y,z,g)},decryptBlock:function(b,c){var a=b[c+1];b[c+1]=b[c+3];b[c+3]=a;this._doCryptBlock(b,c,this._invKeySchedule,p,q,s,t,v);a=b[c+1];b[c+1]=b[c+3];b[c+3]=a},_doCryptBlock:function(b,c,a,f,d,e,g,h){for(var i=this._nRounds,k=b[c]^a[0],l=b[c+1]^a[1],m=b[c+2]^a[2],j=b[c+3]^a[3],n=4,r=1;r>>24]^d[l>>>16&255]^e[m>>>8&255]^g[j&255]^a[n++],p=f[l>>>24]^d[m>>>16&255]^e[j>>>8&255]^ +g[k&255]^a[n++],q=f[m>>>24]^d[j>>>16&255]^e[k>>>8&255]^g[l&255]^a[n++],j=f[j>>>24]^d[k>>>16&255]^e[l>>>8&255]^g[m&255]^a[n++],k=o,l=p,m=q;o=(h[k>>>24]<<24|h[l>>>16&255]<<16|h[m>>>8&255]<<8|h[j&255])^a[n++];p=(h[l>>>24]<<24|h[m>>>16&255]<<16|h[j>>>8&255]<<8|h[k&255])^a[n++];q=(h[m>>>24]<<24|h[j>>>16&255]<<16|h[k>>>8&255]<<8|h[l&255])^a[n++];j=(h[j>>>24]<<24|h[k>>>16&255]<<16|h[l>>>8&255]<<8|h[m&255])^a[n++];b[c]=o;b[c+1]=p;b[c+2]=q;b[c+3]=j},keySize:8});r.AES=u._createHelper(o)})(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/aes.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/aes.js new file mode 100644 index 000000000..cb90e1bae --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/aes.js @@ -0,0 +1,213 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + + // Lookup tables + var SBOX = []; + var INV_SBOX = []; + var SUB_MIX_0 = []; + var SUB_MIX_1 = []; + var SUB_MIX_2 = []; + var SUB_MIX_3 = []; + var INV_SUB_MIX_0 = []; + var INV_SUB_MIX_1 = []; + var INV_SUB_MIX_2 = []; + var INV_SUB_MIX_3 = []; + + // Compute lookup tables + (function () { + // Compute double table + var d = []; + for (var i = 0; i < 256; i++) { + if (i < 128) { + d[i] = i << 1; + } else { + d[i] = (i << 1) ^ 0x11b; + } + } + + // Walk GF(2^8) + var x = 0; + var xi = 0; + for (var i = 0; i < 256; i++) { + // Compute sbox + var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4); + sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63; + SBOX[x] = sx; + INV_SBOX[sx] = x; + + // Compute multiplication + var x2 = d[x]; + var x4 = d[x2]; + var x8 = d[x4]; + + // Compute sub bytes, mix columns tables + var t = (d[sx] * 0x101) ^ (sx * 0x1010100); + SUB_MIX_0[x] = (t << 24) | (t >>> 8); + SUB_MIX_1[x] = (t << 16) | (t >>> 16); + SUB_MIX_2[x] = (t << 8) | (t >>> 24); + SUB_MIX_3[x] = t; + + // Compute inv sub bytes, inv mix columns tables + var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100); + INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8); + INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16); + INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24); + INV_SUB_MIX_3[sx] = t; + + // Compute next counter + if (!x) { + x = xi = 1; + } else { + x = x2 ^ d[d[d[x8 ^ x2]]]; + xi ^= d[d[xi]]; + } + } + }()); + + // Precomputed Rcon lookup + var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]; + + /** + * AES block cipher algorithm. + */ + var AES = C_algo.AES = BlockCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + var keySize = key.sigBytes / 4; + + // Compute number of rounds + var nRounds = this._nRounds = keySize + 6 + + // Compute number of key schedule rows + var ksRows = (nRounds + 1) * 4; + + // Compute key schedule + var keySchedule = this._keySchedule = []; + for (var ksRow = 0; ksRow < ksRows; ksRow++) { + if (ksRow < keySize) { + keySchedule[ksRow] = keyWords[ksRow]; + } else { + var t = keySchedule[ksRow - 1]; + + if (!(ksRow % keySize)) { + // Rot word + t = (t << 8) | (t >>> 24); + + // Sub word + t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; + + // Mix Rcon + t ^= RCON[(ksRow / keySize) | 0] << 24; + } else if (keySize > 6 && ksRow % keySize == 4) { + // Sub word + t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff]; + } + + keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; + } + } + + // Compute inv key schedule + var invKeySchedule = this._invKeySchedule = []; + for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { + var ksRow = ksRows - invKsRow; + + if (invKsRow % 4) { + var t = keySchedule[ksRow]; + } else { + var t = keySchedule[ksRow - 4]; + } + + if (invKsRow < 4 || ksRow <= 4) { + invKeySchedule[invKsRow] = t; + } else { + invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^ + INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]]; + } + } + }, + + encryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); + }, + + decryptBlock: function (M, offset) { + // Swap 2nd and 4th rows + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; + + this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); + + // Inv swap 2nd and 4th rows + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; + }, + + _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { + // Shortcut + var nRounds = this._nRounds; + + // Get input, add round key + var s0 = M[offset] ^ keySchedule[0]; + var s1 = M[offset + 1] ^ keySchedule[1]; + var s2 = M[offset + 2] ^ keySchedule[2]; + var s3 = M[offset + 3] ^ keySchedule[3]; + + // Key schedule row counter + var ksRow = 4; + + // Rounds + for (var round = 1; round < nRounds; round++) { + // Shift rows, sub bytes, mix columns, add round key + var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++]; + var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++]; + var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++]; + var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++]; + + // Update state + s0 = t0; + s1 = t1; + s2 = t2; + s3 = t3; + } + + // Shift rows, sub bytes, add round key + var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]; + var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]; + var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]; + var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]; + + // Set output + M[offset] = t0; + M[offset + 1] = t1; + M[offset + 2] = t2; + M[offset + 3] = t3; + }, + + keySize: 256/32 + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg); + */ + C.AES = BlockCipher._createHelper(AES); +}()); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/cipher-core-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/cipher-core-min.js new file mode 100644 index 000000000..9c377d6ab --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/cipher-core-min.js @@ -0,0 +1,14 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +CryptoJS.lib.Cipher||function(r){var f=CryptoJS,e=f.lib,i=e.Base,j=e.WordArray,o=e.BufferedBlockAlgorithm,p=f.enc.Base64,s=f.algo.EvpKDF,l=e.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(a,b){return this.create(this._ENC_XFORM_MODE,a,b)},createDecryptor:function(a,b){return this.create(this._DEC_XFORM_MODE,a,b)},init:function(a,b,c){this.cfg=this.cfg.extend(c);this._xformMode=a;this._key=b;this.reset()},reset:function(){o.reset.call(this);this._doReset()},process:function(a){this._append(a); +return this._process()},finalize:function(a){a&&this._append(a);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){return function(a){return{encrypt:function(b,c,d){return("string"==typeof c?q:g).encrypt(a,b,c,d)},decrypt:function(b,c,d){return("string"==typeof c?q:g).decrypt(a,b,c,d)}}}}()});e.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var k=f.mode={},t=e.BlockCipherMode=i.extend({createEncryptor:function(a, +b){return this.Encryptor.create(a,b)},createDecryptor:function(a,b){return this.Decryptor.create(a,b)},init:function(a,b){this._cipher=a;this._iv=b}}),k=k.CBC=function(){function a(a,b,m){var h=this._iv;h?this._iv=r:h=this._prevBlock;for(var e=0;e>>2]&255}};e.BlockCipher=l.extend({cfg:l.cfg.extend({mode:k,padding:u}),reset:function(){l.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=a.createEncryptor; +else c=a.createDecryptor,this._minBufferSize=1;this._mode=c.call(a,this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var n=e.CipherParams=i.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),k=(f.format={}).OpenSSL= +{stringify:function(a){var b=a.ciphertext,a=a.salt;return(a?j.create([1398893684,1701076831]).concat(a).concat(b):b).toString(p)},parse:function(a){var a=p.parse(a),b=a.words;if(1398893684==b[0]&&1701076831==b[1]){var c=j.create(b.slice(2,4));b.splice(0,4);a.sigBytes-=16}return n.create({ciphertext:a,salt:c})}},g=e.SerializableCipher=i.extend({cfg:i.extend({format:k}),encrypt:function(a,b,c,d){var d=this.cfg.extend(d),e=a.createEncryptor(c,d),b=e.finalize(b),e=e.cfg;return n.create({ciphertext:b, +key:c,iv:e.iv,algorithm:a,mode:e.mode,padding:e.padding,blockSize:a.blockSize,formatter:d.format})},decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);return a.createDecryptor(c,d).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),f=(f.kdf={}).OpenSSL={execute:function(a,b,c,d){d||(d=j.random(8));a=s.create({keySize:b+c}).compute(a,d);c=j.create(a.words.slice(b),4*c);a.sigBytes=4*b;return n.create({key:a,iv:c,salt:d})}},q=e.PasswordBasedCipher= +g.extend({cfg:g.cfg.extend({kdf:f}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);c=d.kdf.execute(c,a.keySize,a.ivSize);d.iv=c.iv;a=g.encrypt.call(this,a,b,c.key,d);a.mixIn(c);return a},decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);c=d.kdf.execute(c,a.keySize,a.ivSize,b.salt);d.iv=c.iv;return g.decrypt.call(this,a,b,c.key,d)}})}(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/cipher-core.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/cipher-core.js new file mode 100644 index 000000000..42e56f2e4 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/cipher-core.js @@ -0,0 +1,863 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +/** + * Cipher core components. + */ +CryptoJS.lib.Cipher || (function (undefined) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var Base64 = C_enc.Base64; + var C_algo = C.algo; + var EvpKDF = C_algo.EvpKDF; + + /** + * Abstract base cipher template. + * + * @property {number} keySize This cipher's key size. Default: 4 (128 bits) + * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits) + * @property {number} _ENC_XFORM_MODE A constant representing encryption mode. + * @property {number} _DEC_XFORM_MODE A constant representing decryption mode. + */ + var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + * + * @property {WordArray} iv The IV to use for this operation. + */ + cfg: Base.extend(), + + /** + * Creates this cipher in encryption mode. + * + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {Cipher} A cipher instance. + * + * @static + * + * @example + * + * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray }); + */ + createEncryptor: function (key, cfg) { + return this.create(this._ENC_XFORM_MODE, key, cfg); + }, + + /** + * Creates this cipher in decryption mode. + * + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {Cipher} A cipher instance. + * + * @static + * + * @example + * + * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray }); + */ + createDecryptor: function (key, cfg) { + return this.create(this._DEC_XFORM_MODE, key, cfg); + }, + + /** + * Initializes a newly created cipher. + * + * @param {number} xformMode Either the encryption or decryption transormation mode constant. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @example + * + * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }); + */ + init: function (xformMode, key, cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); + + // Store transform mode and key + this._xformMode = xformMode; + this._key = key; + + // Set initial values + this.reset(); + }, + + /** + * Resets this cipher to its initial state. + * + * @example + * + * cipher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); + + // Perform concrete-cipher logic + this._doReset(); + }, + + /** + * Adds data to be encrypted or decrypted. + * + * @param {WordArray|string} dataUpdate The data to encrypt or decrypt. + * + * @return {WordArray} The data after processing. + * + * @example + * + * var encrypted = cipher.process('data'); + * var encrypted = cipher.process(wordArray); + */ + process: function (dataUpdate) { + // Append + this._append(dataUpdate); + + // Process available blocks + return this._process(); + }, + + /** + * Finalizes the encryption or decryption process. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt. + * + * @return {WordArray} The data after final processing. + * + * @example + * + * var encrypted = cipher.finalize(); + * var encrypted = cipher.finalize('data'); + * var encrypted = cipher.finalize(wordArray); + */ + finalize: function (dataUpdate) { + // Final data update + if (dataUpdate) { + this._append(dataUpdate); + } + + // Perform concrete-cipher logic + var finalProcessedData = this._doFinalize(); + + return finalProcessedData; + }, + + keySize: 128/32, + + ivSize: 128/32, + + _ENC_XFORM_MODE: 1, + + _DEC_XFORM_MODE: 2, + + /** + * Creates shortcut functions to a cipher's object interface. + * + * @param {Cipher} cipher The cipher to create a helper for. + * + * @return {Object} An object with encrypt and decrypt shortcut functions. + * + * @static + * + * @example + * + * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES); + */ + _createHelper: (function () { + function selectCipherStrategy(key) { + if (typeof key == 'string') { + return PasswordBasedCipher; + } else { + return SerializableCipher; + } + } + + return function (cipher) { + return { + encrypt: function (message, key, cfg) { + return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); + }, + + decrypt: function (ciphertext, key, cfg) { + return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); + } + }; + }; + }()) + }); + + /** + * Abstract base stream cipher template. + * + * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits) + */ + var StreamCipher = C_lib.StreamCipher = Cipher.extend({ + _doFinalize: function () { + // Process partial blocks + var finalProcessedBlocks = this._process(!!'flush'); + + return finalProcessedBlocks; + }, + + blockSize: 1 + }); + + /** + * Mode namespace. + */ + var C_mode = C.mode = {}; + + /** + * Abstract base block cipher mode template. + */ + var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ + /** + * Creates this mode for encryption. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @static + * + * @example + * + * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words); + */ + createEncryptor: function (cipher, iv) { + return this.Encryptor.create(cipher, iv); + }, + + /** + * Creates this mode for decryption. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @static + * + * @example + * + * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words); + */ + createDecryptor: function (cipher, iv) { + return this.Decryptor.create(cipher, iv); + }, + + /** + * Initializes a newly created mode. + * + * @param {Cipher} cipher A block cipher instance. + * @param {Array} iv The IV words. + * + * @example + * + * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words); + */ + init: function (cipher, iv) { + this._cipher = cipher; + this._iv = iv; + } + }); + + /** + * Cipher Block Chaining mode. + */ + var CBC = C_mode.CBC = (function () { + /** + * Abstract base CBC mode. + */ + var CBC = BlockCipherMode.extend(); + + /** + * CBC encryptor. + */ + CBC.Encryptor = CBC.extend({ + /** + * Processes the data block at offset. + * + * @param {Array} words The data words to operate on. + * @param {number} offset The offset where the block starts. + * + * @example + * + * mode.processBlock(data.words, offset); + */ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // XOR and encrypt + xorBlock.call(this, words, offset, blockSize); + cipher.encryptBlock(words, offset); + + // Remember this block to use with next block + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); + + /** + * CBC decryptor. + */ + CBC.Decryptor = CBC.extend({ + /** + * Processes the data block at offset. + * + * @param {Array} words The data words to operate on. + * @param {number} offset The offset where the block starts. + * + * @example + * + * mode.processBlock(data.words, offset); + */ + processBlock: function (words, offset) { + // Shortcuts + var cipher = this._cipher; + var blockSize = cipher.blockSize; + + // Remember this block to use with next block + var thisBlock = words.slice(offset, offset + blockSize); + + // Decrypt and XOR + cipher.decryptBlock(words, offset); + xorBlock.call(this, words, offset, blockSize); + + // This block becomes the previous block + this._prevBlock = thisBlock; + } + }); + + function xorBlock(words, offset, blockSize) { + // Shortcut + var iv = this._iv; + + // Choose mixing block + if (iv) { + var block = iv; + + // Remove IV for subsequent blocks + this._iv = undefined; + } else { + var block = this._prevBlock; + } + + // XOR blocks + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= block[i]; + } + } + + return CBC; + }()); + + /** + * Padding namespace. + */ + var C_pad = C.pad = {}; + + /** + * PKCS #5/7 padding strategy. + */ + var Pkcs7 = C_pad.Pkcs7 = { + /** + * Pads data using the algorithm defined in PKCS #5/7. + * + * @param {WordArray} data The data to pad. + * @param {number} blockSize The multiple that the data should be padded to. + * + * @static + * + * @example + * + * CryptoJS.pad.Pkcs7.pad(wordArray, 4); + */ + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + + // Create padding word + var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes; + + // Create padding + var paddingWords = []; + for (var i = 0; i < nPaddingBytes; i += 4) { + paddingWords.push(paddingWord); + } + var padding = WordArray.create(paddingWords, nPaddingBytes); + + // Add padding + data.concat(padding); + }, + + /** + * Unpads data that had been padded using the algorithm defined in PKCS #5/7. + * + * @param {WordArray} data The data to unpad. + * + * @static + * + * @example + * + * CryptoJS.pad.Pkcs7.unpad(wordArray); + */ + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } + }; + + /** + * Abstract base block cipher template. + * + * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits) + */ + var BlockCipher = C_lib.BlockCipher = Cipher.extend({ + /** + * Configuration options. + * + * @property {Mode} mode The block mode to use. Default: CBC + * @property {Padding} padding The padding strategy to use. Default: Pkcs7 + */ + cfg: Cipher.cfg.extend({ + mode: CBC, + padding: Pkcs7 + }), + + reset: function () { + // Reset cipher + Cipher.reset.call(this); + + // Shortcuts + var cfg = this.cfg; + var iv = cfg.iv; + var mode = cfg.mode; + + // Reset block mode + if (this._xformMode == this._ENC_XFORM_MODE) { + var modeCreator = mode.createEncryptor; + } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { + var modeCreator = mode.createDecryptor; + + // Keep at least one block in the buffer for unpadding + this._minBufferSize = 1; + } + this._mode = modeCreator.call(mode, this, iv && iv.words); + }, + + _doProcessBlock: function (words, offset) { + this._mode.processBlock(words, offset); + }, + + _doFinalize: function () { + // Shortcut + var padding = this.cfg.padding; + + // Finalize + if (this._xformMode == this._ENC_XFORM_MODE) { + // Pad data + padding.pad(this._data, this.blockSize); + + // Process final blocks + var finalProcessedBlocks = this._process(!!'flush'); + } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ { + // Process final blocks + var finalProcessedBlocks = this._process(!!'flush'); + + // Unpad data + padding.unpad(finalProcessedBlocks); + } + + return finalProcessedBlocks; + }, + + blockSize: 128/32 + }); + + /** + * A collection of cipher parameters. + * + * @property {WordArray} ciphertext The raw ciphertext. + * @property {WordArray} key The key to this ciphertext. + * @property {WordArray} iv The IV used in the ciphering operation. + * @property {WordArray} salt The salt used with a key derivation function. + * @property {Cipher} algorithm The cipher algorithm. + * @property {Mode} mode The block mode used in the ciphering operation. + * @property {Padding} padding The padding scheme used in the ciphering operation. + * @property {number} blockSize The block size of the cipher. + * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string. + */ + var CipherParams = C_lib.CipherParams = Base.extend({ + /** + * Initializes a newly created cipher params object. + * + * @param {Object} cipherParams An object with any of the possible cipher parameters. + * + * @example + * + * var cipherParams = CryptoJS.lib.CipherParams.create({ + * ciphertext: ciphertextWordArray, + * key: keyWordArray, + * iv: ivWordArray, + * salt: saltWordArray, + * algorithm: CryptoJS.algo.AES, + * mode: CryptoJS.mode.CBC, + * padding: CryptoJS.pad.PKCS7, + * blockSize: 4, + * formatter: CryptoJS.format.OpenSSL + * }); + */ + init: function (cipherParams) { + this.mixIn(cipherParams); + }, + + /** + * Converts this cipher params object to a string. + * + * @param {Format} formatter (Optional) The formatting strategy to use. + * + * @return {string} The stringified cipher params. + * + * @throws Error If neither the formatter nor the default formatter is set. + * + * @example + * + * var string = cipherParams + ''; + * var string = cipherParams.toString(); + * var string = cipherParams.toString(CryptoJS.format.OpenSSL); + */ + toString: function (formatter) { + return (formatter || this.formatter).stringify(this); + } + }); + + /** + * Format namespace. + */ + var C_format = C.format = {}; + + /** + * OpenSSL formatting strategy. + */ + var OpenSSLFormatter = C_format.OpenSSL = { + /** + * Converts a cipher params object to an OpenSSL-compatible string. + * + * @param {CipherParams} cipherParams The cipher params object. + * + * @return {string} The OpenSSL-compatible string. + * + * @static + * + * @example + * + * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams); + */ + stringify: function (cipherParams) { + // Shortcuts + var ciphertext = cipherParams.ciphertext; + var salt = cipherParams.salt; + + // Format + if (salt) { + var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); + } else { + var wordArray = ciphertext; + } + + return wordArray.toString(Base64); + }, + + /** + * Converts an OpenSSL-compatible string to a cipher params object. + * + * @param {string} openSSLStr The OpenSSL-compatible string. + * + * @return {CipherParams} The cipher params object. + * + * @static + * + * @example + * + * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString); + */ + parse: function (openSSLStr) { + // Parse base64 + var ciphertext = Base64.parse(openSSLStr); + + // Shortcut + var ciphertextWords = ciphertext.words; + + // Test for salt + if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { + // Extract salt + var salt = WordArray.create(ciphertextWords.slice(2, 4)); + + // Remove salt from ciphertext + ciphertextWords.splice(0, 4); + ciphertext.sigBytes -= 16; + } + + return CipherParams.create({ ciphertext: ciphertext, salt: salt }); + } + }; + + /** + * A cipher wrapper that returns ciphertext as a serializable cipher params object. + */ + var SerializableCipher = C_lib.SerializableCipher = Base.extend({ + /** + * Configuration options. + * + * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL + */ + cfg: Base.extend({ + format: OpenSSLFormatter + }), + + /** + * Encrypts a message. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {WordArray|string} message The message to encrypt. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {CipherParams} A cipher params object. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key); + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv }); + * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + */ + encrypt: function (cipher, message, key, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Encrypt + var encryptor = cipher.createEncryptor(key, cfg); + var ciphertext = encryptor.finalize(message); + + // Shortcut + var cipherCfg = encryptor.cfg; + + // Create and return serializable cipher params + return CipherParams.create({ + ciphertext: ciphertext, + key: key, + iv: cipherCfg.iv, + algorithm: cipher, + mode: cipherCfg.mode, + padding: cipherCfg.padding, + blockSize: cipher.blockSize, + formatter: cfg.format + }); + }, + + /** + * Decrypts serialized ciphertext. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {CipherParams|string} ciphertext The ciphertext to decrypt. + * @param {WordArray} key The key. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {WordArray} The plaintext. + * + * @static + * + * @example + * + * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL }); + */ + decrypt: function (cipher, ciphertext, key, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Convert string to CipherParams + ciphertext = this._parse(ciphertext, cfg.format); + + // Decrypt + var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); + + return plaintext; + }, + + /** + * Converts serialized ciphertext to CipherParams, + * else assumed CipherParams already and returns ciphertext unchanged. + * + * @param {CipherParams|string} ciphertext The ciphertext. + * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext. + * + * @return {CipherParams} The unserialized ciphertext. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format); + */ + _parse: function (ciphertext, format) { + if (typeof ciphertext == 'string') { + return format.parse(ciphertext, this); + } else { + return ciphertext; + } + } + }); + + /** + * Key derivation function namespace. + */ + var C_kdf = C.kdf = {}; + + /** + * OpenSSL key derivation function. + */ + var OpenSSLKdf = C_kdf.OpenSSL = { + /** + * Derives a key and IV from a password. + * + * @param {string} password The password to derive from. + * @param {number} keySize The size in words of the key to generate. + * @param {number} ivSize The size in words of the IV to generate. + * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly. + * + * @return {CipherParams} A cipher params object with the key, IV, and salt. + * + * @static + * + * @example + * + * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32); + * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt'); + */ + execute: function (password, keySize, ivSize, salt) { + // Generate random salt + if (!salt) { + salt = WordArray.random(64/8); + } + + // Derive key and IV + var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt); + + // Separate key and IV + var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); + key.sigBytes = keySize * 4; + + // Return params + return CipherParams.create({ key: key, iv: iv, salt: salt }); + } + }; + + /** + * A serializable cipher wrapper that derives the key from a password, + * and returns ciphertext as a serializable cipher params object. + */ + var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ + /** + * Configuration options. + * + * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL + */ + cfg: SerializableCipher.cfg.extend({ + kdf: OpenSSLKdf + }), + + /** + * Encrypts a message using a password. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {WordArray|string} message The message to encrypt. + * @param {string} password The password. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {CipherParams} A cipher params object. + * + * @static + * + * @example + * + * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password'); + * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL }); + */ + encrypt: function (cipher, message, password, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Derive key and other params + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize); + + // Add IV to config + cfg.iv = derivedParams.iv; + + // Encrypt + var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); + + // Mix in derived params + ciphertext.mixIn(derivedParams); + + return ciphertext; + }, + + /** + * Decrypts serialized ciphertext using a password. + * + * @param {Cipher} cipher The cipher algorithm to use. + * @param {CipherParams|string} ciphertext The ciphertext to decrypt. + * @param {string} password The password. + * @param {Object} cfg (Optional) The configuration options to use for this operation. + * + * @return {WordArray} The plaintext. + * + * @static + * + * @example + * + * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL }); + * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL }); + */ + decrypt: function (cipher, ciphertext, password, cfg) { + // Apply config defaults + cfg = this.cfg.extend(cfg); + + // Convert string to CipherParams + ciphertext = this._parse(ciphertext, cfg.format); + + // Derive key and other params + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt); + + // Add IV to config + cfg.iv = derivedParams.iv; + + // Decrypt + var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); + + return plaintext; + } + }); +}()); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/core-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/core-min.js new file mode 100644 index 000000000..88fffe3dd --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/core-min.js @@ -0,0 +1,12 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +var CryptoJS=CryptoJS||function(h,o){var f={},j=f.lib={},k=j.Base=function(){function a(){}return{extend:function(b){a.prototype=this;var c=new a;b&&c.mixIn(b);c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),i=j.WordArray=k.extend({init:function(a,b){a= +this.words=a||[];this.sigBytes=b!=o?b:4*a.length},toString:function(a){return(a||p).stringify(this)},concat:function(a){var b=this.words,c=a.words,d=this.sigBytes,a=a.sigBytes;this.clamp();if(d%4)for(var e=0;e>>2]|=(c[e>>>2]>>>24-8*(e%4)&255)<<24-8*((d+e)%4);else if(65535>>2]=c[e>>>2];else b.push.apply(b,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-8*(b%4);a.length=h.ceil(b/4)},clone:function(){var a= +k.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],c=0;c>>2]>>>24-8*(d%4)&255;c.push((e>>>4).toString(16));c.push((e&15).toString(16))}return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>3]|=parseInt(a.substr(d,2),16)<<24-4*(d%8);return i.create(c,b/2)}},n=l.Latin1={stringify:function(a){for(var b= +a.words,a=a.sigBytes,c=[],d=0;d>>2]>>>24-8*(d%4)&255));return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return i.create(c,b)}},q=l.Utf8={stringify:function(a){try{return decodeURIComponent(escape(n.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return n.parse(unescape(encodeURIComponent(a)))}},m=j.BufferedBlockAlgorithm=k.extend({reset:function(){this._data=i.create(); +this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=q.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,c=b.words,d=b.sigBytes,e=this.blockSize,f=d/(4*e),f=a?h.ceil(f):h.max((f|0)-this._minBufferSize,0),a=f*e,d=h.min(4*a,d);if(a){for(var g=0;g>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); + } + } else if (thatWords.length > 0xffff) { + // Copy one word at a time + for (var i = 0; i < thatSigBytes; i += 4) { + thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2]; + } + } else { + // Copy all words at once + thisWords.push.apply(thisWords, thatWords); + } + this.sigBytes += thatSigBytes; + + // Chainable + return this; + }, + + /** + * Removes insignificant bits. + * + * @example + * + * wordArray.clamp(); + */ + clamp: function () { + // Shortcuts + var words = this.words; + var sigBytes = this.sigBytes; + + // Clamp + words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); + words.length = Math.ceil(sigBytes / 4); + }, + + /** + * Creates a copy of this word array. + * + * @return {WordArray} The clone. + * + * @example + * + * var clone = wordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone.words = this.words.slice(0); + + return clone; + }, + + /** + * Creates a word array filled with random bytes. + * + * @param {number} nBytes The number of random bytes to generate. + * + * @return {WordArray} The random word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.random(16); + */ + random: function (nBytes) { + var words = []; + for (var i = 0; i < nBytes; i += 4) { + words.push((Math.random() * 0x100000000) | 0); + } + + return WordArray.create(words, nBytes); + } + }); + + /** + * Encoder namespace. + */ + var C_enc = C.enc = {}; + + /** + * Hex encoding strategy. + */ + var Hex = C_enc.Hex = { + /** + * Converts a word array to a hex string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The hex string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.enc.Hex.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var hexChars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + hexChars.push((bite >>> 4).toString(16)); + hexChars.push((bite & 0x0f).toString(16)); + } + + return hexChars.join(''); + }, + + /** + * Converts a hex string to a word array. + * + * @param {string} hexStr The hex string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Hex.parse(hexString); + */ + parse: function (hexStr) { + // Shortcut + var hexStrLength = hexStr.length; + + // Convert + var words = []; + for (var i = 0; i < hexStrLength; i += 2) { + words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); + } + + return WordArray.create(words, hexStrLength / 2); + } + }; + + /** + * Latin1 encoding strategy. + */ + var Latin1 = C_enc.Latin1 = { + /** + * Converts a word array to a Latin1 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Latin1 string. + * + * @static + * + * @example + * + * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var latin1Chars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + latin1Chars.push(String.fromCharCode(bite)); + } + + return latin1Chars.join(''); + }, + + /** + * Converts a Latin1 string to a word array. + * + * @param {string} latin1Str The Latin1 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); + */ + parse: function (latin1Str) { + // Shortcut + var latin1StrLength = latin1Str.length; + + // Convert + var words = []; + for (var i = 0; i < latin1StrLength; i++) { + words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); + } + + return WordArray.create(words, latin1StrLength); + } + }; + + /** + * UTF-8 encoding strategy. + */ + var Utf8 = C_enc.Utf8 = { + /** + * Converts a word array to a UTF-8 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-8 string. + * + * @static + * + * @example + * + * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); + */ + stringify: function (wordArray) { + try { + return decodeURIComponent(escape(Latin1.stringify(wordArray))); + } catch (e) { + throw new Error('Malformed UTF-8 data'); + } + }, + + /** + * Converts a UTF-8 string to a word array. + * + * @param {string} utf8Str The UTF-8 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); + */ + parse: function (utf8Str) { + return Latin1.parse(unescape(encodeURIComponent(utf8Str))); + } + }; + + /** + * Abstract buffered block algorithm template. + * + * The property blockSize must be implemented in a concrete subtype. + * + * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 + */ + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ + /** + * Resets this block algorithm's data buffer to its initial state. + * + * @example + * + * bufferedBlockAlgorithm.reset(); + */ + reset: function () { + // Initial values + this._data = WordArray.create(); + this._nDataBytes = 0; + }, + + /** + * Adds new data to this block algorithm's buffer. + * + * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. + * + * @example + * + * bufferedBlockAlgorithm._append('data'); + * bufferedBlockAlgorithm._append(wordArray); + */ + _append: function (data) { + // Convert string to WordArray, else assume WordArray already + if (typeof data == 'string') { + data = Utf8.parse(data); + } + + // Append + this._data.concat(data); + this._nDataBytes += data.sigBytes; + }, + + /** + * Processes available data blocks. + * + * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. + * + * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. + * + * @return {WordArray} The processed data. + * + * @example + * + * var processedData = bufferedBlockAlgorithm._process(); + * var processedData = bufferedBlockAlgorithm._process(!!'flush'); + */ + _process: function (doFlush) { + // Shortcuts + var data = this._data; + var dataWords = data.words; + var dataSigBytes = data.sigBytes; + var blockSize = this.blockSize; + var blockSizeBytes = blockSize * 4; + + // Count blocks ready + var nBlocksReady = dataSigBytes / blockSizeBytes; + if (doFlush) { + // Round up to include partial blocks + nBlocksReady = Math.ceil(nBlocksReady); + } else { + // Round down to include only full blocks, + // less the number of blocks that must remain in the buffer + nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); + } + + // Count words ready + var nWordsReady = nBlocksReady * blockSize; + + // Count bytes ready + var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); + + // Process blocks + if (nWordsReady) { + for (var offset = 0; offset < nWordsReady; offset += blockSize) { + // Perform concrete-algorithm logic + this._doProcessBlock(dataWords, offset); + } + + // Remove processed words + var processedWords = dataWords.splice(0, nWordsReady); + data.sigBytes -= nBytesReady; + } + + // Return processed words + return WordArray.create(processedWords, nBytesReady); + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = bufferedBlockAlgorithm.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone._data = this._data.clone(); + + return clone; + }, + + _minBufferSize: 0 + }); + + /** + * Abstract hasher template. + * + * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) + */ + var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + */ + // cfg: Base.extend(), + + /** + * Initializes a newly created hasher. + * + * @param {Object} cfg (Optional) The configuration options to use for this hash computation. + * + * @example + * + * var hasher = CryptoJS.algo.SHA256.create(); + */ + init: function (cfg) { + // Apply config defaults + // this.cfg = this.cfg.extend(cfg); + + // Set initial values + this.reset(); + }, + + /** + * Resets this hasher to its initial state. + * + * @example + * + * hasher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); + + // Perform concrete-hasher logic + this._doReset(); + }, + + /** + * Updates this hasher with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {Hasher} This hasher. + * + * @example + * + * hasher.update('message'); + * hasher.update(wordArray); + */ + update: function (messageUpdate) { + // Append + this._append(messageUpdate); + + // Update the hash + this._process(); + + // Chainable + return this; + }, + + /** + * Finalizes the hash computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The hash. + * + * @example + * + * var hash = hasher.finalize(); + * var hash = hasher.finalize('message'); + * var hash = hasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Final message update + if (messageUpdate) { + this._append(messageUpdate); + } + + // Perform concrete-hasher logic + this._doFinalize(); + + return this._hash; + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = hasher.clone(); + */ + clone: function () { + var clone = BufferedBlockAlgorithm.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + }, + + blockSize: 512/32, + + /** + * Creates a shortcut function to a hasher's object interface. + * + * @param {Hasher} hasher The hasher to create a helper for. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); + */ + _createHelper: function (hasher) { + return function (message, cfg) { + return hasher.create(cfg).finalize(message); + }; + }, + + /** + * Creates a shortcut function to the HMAC's object interface. + * + * @param {Hasher} hasher The hasher to use in this HMAC helper. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); + */ + _createHmacHelper: function (hasher) { + return function (message, key) { + return C_algo.HMAC.create(hasher, key).finalize(message); + }; + } + }); + + /** + * Algorithm namespace. + */ + var C_algo = C.algo = {}; + + return C; +}(Math)); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/enc-base64-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/enc-base64-min.js new file mode 100644 index 000000000..a4ef51cd0 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/enc-base64-min.js @@ -0,0 +1,8 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function(){var h=CryptoJS,i=h.lib.WordArray;h.enc.Base64={stringify:function(b){var e=b.words,f=b.sigBytes,c=this._map;b.clamp();for(var b=[],a=0;a>>2]>>>24-8*(a%4)&255)<<16|(e[a+1>>>2]>>>24-8*((a+1)%4)&255)<<8|e[a+2>>>2]>>>24-8*((a+2)%4)&255,g=0;4>g&&a+0.75*g>>6*(3-g)&63));if(e=c.charAt(64))for(;b.length%4;)b.push(e);return b.join("")},parse:function(b){var e=b.length,f=this._map,c=f.charAt(64);c&&(c=b.indexOf(c),-1!=c&&(e=c));for(var c=[],a=0,d=0;d< +e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))<<2*(d%4),h=f.indexOf(b.charAt(d))>>>6-2*(d%4);c[a>>>2]|=(g|h)<<24-8*(a%4);a++}return i.create(c,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/enc-base64.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/enc-base64.js new file mode 100644 index 000000000..c137b4cc0 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/enc-base64.js @@ -0,0 +1,109 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * Base64 encoding strategy. + */ + var Base64 = C_enc.Base64 = { + /** + * Converts a word array to a Base64 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Base64 string. + * + * @static + * + * @example + * + * var base64String = CryptoJS.enc.Base64.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var map = this._map; + + // Clamp excess bits + wordArray.clamp(); + + // Convert + var base64Chars = []; + for (var i = 0; i < sigBytes; i += 3) { + var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff; + var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff; + + var triplet = (byte1 << 16) | (byte2 << 8) | byte3; + + for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) { + base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f)); + } + } + + // Add padding + var paddingChar = map.charAt(64); + if (paddingChar) { + while (base64Chars.length % 4) { + base64Chars.push(paddingChar); + } + } + + return base64Chars.join(''); + }, + + /** + * Converts a Base64 string to a word array. + * + * @param {string} base64Str The Base64 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Base64.parse(base64String); + */ + parse: function (base64Str) { + // Shortcuts + var base64StrLength = base64Str.length; + var map = this._map; + + // Ignore padding + var paddingChar = map.charAt(64); + if (paddingChar) { + var paddingIndex = base64Str.indexOf(paddingChar); + if (paddingIndex != -1) { + base64StrLength = paddingIndex; + } + } + + // Convert + var words = []; + var nBytes = 0; + for (var i = 0; i < base64StrLength; i++) { + if (i % 4) { + var bits1 = map.indexOf(base64Str.charAt(i - 1)) << ((i % 4) * 2); + var bits2 = map.indexOf(base64Str.charAt(i)) >>> (6 - (i % 4) * 2); + words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8); + nBytes++; + } + } + + return WordArray.create(words, nBytes); + }, + + _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' + }; +}()); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/enc-utf16-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/enc-utf16-min.js new file mode 100644 index 000000000..8fbb81cc0 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/enc-utf16-min.js @@ -0,0 +1,7 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function(){var e=CryptoJS,f=e.lib.WordArray;e.enc.Utf16={stringify:function(b){for(var d=b.words,b=b.sigBytes,c=[],a=0;a>>2]>>>16-8*(a%4)&65535));return c.join("")},parse:function(b){for(var d=b.length,c=[],a=0;a>>1]|=b.charCodeAt(a)<<16-16*(a%2);return f.create(c,2*d)}}})(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/enc-utf16.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/enc-utf16.js new file mode 100644 index 000000000..a3da231c4 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/enc-utf16.js @@ -0,0 +1,72 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + + /** + * UTF-16 BE encoding strategy. + */ + var Utf16 = C_enc.Utf16 = { + /** + * Converts a word array to a UTF-16 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-16 string. + * + * @static + * + * @example + * + * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var utf16Chars = []; + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff; + utf16Chars.push(String.fromCharCode(codePoint)); + } + + return utf16Chars.join(''); + }, + + /** + * Converts a UTF-16 string to a word array. + * + * @param {string} utf16Str The UTF-16 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf16.parse(utf16String); + */ + parse: function (utf16Str) { + // Shortcut + var utf16StrLength = utf16Str.length; + + // Convert + var words = []; + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16); + } + + return WordArray.create(words, utf16StrLength * 2); + } + }; +}()); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/evpkdf-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/evpkdf-min.js new file mode 100644 index 000000000..7237f4f1f --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/evpkdf-min.js @@ -0,0 +1,8 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function(){var b=CryptoJS,a=b.lib,f=a.Base,j=a.WordArray,a=b.algo,k=a.EvpKDF=f.extend({cfg:f.extend({keySize:4,hasher:a.MD5,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,d=c.hasher.create(),g=j.create(),f=g.words,h=c.keySize,c=c.iterations;f.lengthe&&(b=a.finalize(b));for(var f=this._oKey=b.clone(),g=this._iKey=b.clone(),h=f.words,i=g.words,d=0;d hasherBlockSizeBytes) { + key = hasher.finalize(key); + } + + // Clone key for inner and outer pads + var oKey = this._oKey = key.clone(); + var iKey = this._iKey = key.clone(); + + // Shortcuts + var oKeyWords = oKey.words; + var iKeyWords = iKey.words; + + // XOR keys with pad constants + for (var i = 0; i < hasherBlockSize; i++) { + oKeyWords[i] ^= 0x5c5c5c5c; + iKeyWords[i] ^= 0x36363636; + } + oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; + + // Set initial values + this.reset(); + }, + + /** + * Resets this HMAC to its initial state. + * + * @example + * + * hmacHasher.reset(); + */ + reset: function () { + // Shortcut + var hasher = this._hasher; + + // Reset + hasher.reset(); + hasher.update(this._iKey); + }, + + /** + * Updates this HMAC with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {HMAC} This HMAC instance. + * + * @example + * + * hmacHasher.update('message'); + * hmacHasher.update(wordArray); + */ + update: function (messageUpdate) { + this._hasher.update(messageUpdate); + + // Chainable + return this; + }, + + /** + * Finalizes the HMAC computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The HMAC. + * + * @example + * + * var hmac = hmacHasher.finalize(); + * var hmac = hmacHasher.finalize('message'); + * var hmac = hmacHasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Shortcut + var hasher = this._hasher; + + // Compute HMAC + var innerHash = hasher.finalize(messageUpdate); + hasher.reset(); + var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); + + return hmac; + } + }); +}()); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/md5-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/md5-min.js new file mode 100644 index 000000000..edf85f240 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/md5-min.js @@ -0,0 +1,10 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function(q){function k(b,c,a,f,d,e,g){b=b+(c&a|~c&f)+d+g;return(b<>>32-e)+c}function l(b,c,a,f,d,e,g){b=b+(c&f|a&~f)+d+g;return(b<>>32-e)+c}function m(b,c,a,f,d,e,g){b=b+(c^a^f)+d+g;return(b<>>32-e)+c}function n(b,c,a,f,d,e,g){b=b+(a^(c|~f))+d+g;return(b<>>32-e)+c}var o=CryptoJS,j=o.lib,r=j.WordArray,j=j.Hasher,p=o.algo,i=[];(function(){for(var b=0;64>b;b++)i[b]=4294967296*q.abs(q.sin(b+1))|0})();p=p.MD5=j.extend({_doReset:function(){this._hash=r.create([1732584193,4023233417, +2562383102,271733878])},_doProcessBlock:function(b,c){for(var a=0;16>a;a++){var f=c+a,d=b[f];b[f]=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360}for(var f=this._hash.words,d=f[0],e=f[1],g=f[2],h=f[3],a=0;64>a;a+=4)16>a?(d=k(d,e,g,h,b[c+a],7,i[a]),h=k(h,d,e,g,b[c+a+1],12,i[a+1]),g=k(g,h,d,e,b[c+a+2],17,i[a+2]),e=k(e,g,h,d,b[c+a+3],22,i[a+3])):32>a?(d=l(d,e,g,h,b[c+(a+1)%16],5,i[a]),h=l(h,d,e,g,b[c+(a+6)%16],9,i[a+1]),g=l(g,h,d,e,b[c+(a+11)%16],14,i[a+2]),e=l(e,g,h,d,b[c+a%16],20,i[a+3])):48>a?(d= +m(d,e,g,h,b[c+(3*a+5)%16],4,i[a]),h=m(h,d,e,g,b[c+(3*a+8)%16],11,i[a+1]),g=m(g,h,d,e,b[c+(3*a+11)%16],16,i[a+2]),e=m(e,g,h,d,b[c+(3*a+14)%16],23,i[a+3])):(d=n(d,e,g,h,b[c+3*a%16],6,i[a]),h=n(h,d,e,g,b[c+(3*a+7)%16],10,i[a+1]),g=n(g,h,d,e,b[c+(3*a+14)%16],15,i[a+2]),e=n(e,g,h,d,b[c+(3*a+5)%16],21,i[a+3]));f[0]=f[0]+d|0;f[1]=f[1]+e|0;f[2]=f[2]+g|0;f[3]=f[3]+h|0},_doFinalize:function(){var b=this._data,c=b.words,a=8*this._nDataBytes,f=8*b.sigBytes;c[f>>>5]|=128<<24-f%32;c[(f+64>>>9<<4)+14]=(a<<8|a>>> +24)&16711935|(a<<24|a>>>8)&4278255360;b.sigBytes=4*(c.length+1);this._process();b=this._hash.words;for(c=0;4>c;c++)a=b[c],b[c]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}});o.MD5=j._createHelper(p);o.HmacMD5=j._createHmacHelper(p)})(Math); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/md5.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/md5.js new file mode 100644 index 000000000..517a11511 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/md5.js @@ -0,0 +1,174 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Constants table + var T = []; + + // Compute constants + (function () { + for (var i = 0; i < 64; i++) { + T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0; + } + }()); + + /** + * MD5 hash algorithm. + */ + var MD5 = C_algo.MD5 = Hasher.extend({ + _doReset: function () { + this._hash = WordArray.create([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476 + ]); + }, + + _doProcessBlock: function (M, offset) { + // Swap endian + for (var i = 0; i < 16; i++) { + // Shortcuts + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + + M[offset_i] = ( + (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) | + (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00) + ); + } + + // Shortcut + var H = this._hash.words; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + + // Computation + for (var i = 0; i < 64; i += 4) { + if (i < 16) { + a = FF(a, b, c, d, M[offset + i], 7, T[i]); + d = FF(d, a, b, c, M[offset + i + 1], 12, T[i + 1]); + c = FF(c, d, a, b, M[offset + i + 2], 17, T[i + 2]); + b = FF(b, c, d, a, M[offset + i + 3], 22, T[i + 3]); + } else if (i < 32) { + a = GG(a, b, c, d, M[offset + ((i + 1) % 16)], 5, T[i]); + d = GG(d, a, b, c, M[offset + ((i + 6) % 16)], 9, T[i + 1]); + c = GG(c, d, a, b, M[offset + ((i + 11) % 16)], 14, T[i + 2]); + b = GG(b, c, d, a, M[offset + (i % 16)], 20, T[i + 3]); + } else if (i < 48) { + a = HH(a, b, c, d, M[offset + ((i * 3 + 5) % 16)], 4, T[i]); + d = HH(d, a, b, c, M[offset + ((i * 3 + 8) % 16)], 11, T[i + 1]); + c = HH(c, d, a, b, M[offset + ((i * 3 + 11) % 16)], 16, T[i + 2]); + b = HH(b, c, d, a, M[offset + ((i * 3 + 14) % 16)], 23, T[i + 3]); + } else /* if (i < 64) */ { + a = II(a, b, c, d, M[offset + ((i * 3) % 16)], 6, T[i]); + d = II(d, a, b, c, M[offset + ((i * 3 + 7) % 16)], 10, T[i + 1]); + c = II(c, d, a, b, M[offset + ((i * 3 + 14) % 16)], 15, T[i + 2]); + b = II(b, c, d, a, M[offset + ((i * 3 + 5) % 16)], 21, T[i + 3]); + } + } + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = ( + (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) | + (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00) + ); + data.sigBytes = (dataWords.length + 1) * 4; + + // Hash final blocks + this._process(); + + // Shortcut + var H = this._hash.words; + + // Swap endian + for (var i = 0; i < 4; i++) { + // Shortcut + var H_i = H[i]; + + H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) | + (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00); + } + } + }); + + function FF(a, b, c, d, x, s, t) { + var n = a + ((b & c) | (~b & d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function GG(a, b, c, d, x, s, t) { + var n = a + ((b & d) | (c & ~d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function HH(a, b, c, d, x, s, t) { + var n = a + (b ^ c ^ d) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + function II(a, b, c, d, x, s, t) { + var n = a + (c ^ (b | ~d)) + x + t; + return ((n << s) | (n >>> (32 - s))) + b; + } + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.MD5('message'); + * var hash = CryptoJS.MD5(wordArray); + */ + C.MD5 = Hasher._createHelper(MD5); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacMD5(message, key); + */ + C.HmacMD5 = Hasher._createHmacHelper(MD5); +}(Math)); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/mode-cfb-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/mode-cfb-min.js new file mode 100644 index 000000000..91d13586b --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/mode-cfb-min.js @@ -0,0 +1,7 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +CryptoJS.mode.CFB=function(){function g(c,b,e,a){var d=this._iv;d?(d=d.slice(0),this._iv=void 0):d=this._prevBlock;a.encryptBlock(d,0);for(a=0;a>>2]|=c<<24-8*(b%4);a.sigBytes+=c},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}}; diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-ansix923.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-ansix923.js new file mode 100644 index 000000000..a9a23dd4b --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-ansix923.js @@ -0,0 +1,35 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +/** + * ANSI X.923 padding strategy. + */ +CryptoJS.pad.AnsiX923 = { + pad: function (data, blockSize) { + // Shortcuts + var dataSigBytes = data.sigBytes; + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; + + // Compute last byte position + var lastBytePos = dataSigBytes + nPaddingBytes - 1; + + // Pad + data.clamp(); + data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8); + data.sigBytes += nPaddingBytes; + }, + + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } +}; diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-iso10126-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-iso10126-min.js new file mode 100644 index 000000000..d82141c70 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-iso10126-min.js @@ -0,0 +1,7 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +CryptoJS.pad.Iso10126={pad:function(a,c){var b=4*c,b=b-a.sigBytes%b;a.concat(CryptoJS.lib.WordArray.random(b-1)).concat(CryptoJS.lib.WordArray.create([b<<24],1))},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}}; diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-iso10126.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-iso10126.js new file mode 100644 index 000000000..c26e731f5 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-iso10126.js @@ -0,0 +1,30 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +/** + * ISO 10126 padding strategy. + */ +CryptoJS.pad.Iso10126 = { + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Count padding bytes + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + + // Pad + data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)). + concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); + }, + + unpad: function (data) { + // Get number of padding bytes from last byte + var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff; + + // Remove padding + data.sigBytes -= nPaddingBytes; + } +}; diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-iso97971-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-iso97971-min.js new file mode 100644 index 000000000..d01c753a0 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-iso97971-min.js @@ -0,0 +1,7 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +CryptoJS.pad.Iso97971={pad:function(a,b){a.concat(CryptoJS.lib.WordArray.create([2147483648],1));CryptoJS.pad.ZeroPadding.pad(a,b)},unpad:function(a){CryptoJS.pad.ZeroPadding.unpad(a);a.sigBytes--}}; diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-iso97971.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-iso97971.js new file mode 100644 index 000000000..d62196f68 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-iso97971.js @@ -0,0 +1,26 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +/** + * ISO/IEC 9797-1 Padding Method 2. + */ +CryptoJS.pad.Iso97971 = { + pad: function (data, blockSize) { + // Add 0x80 byte + data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); + + // Zero pad the rest + CryptoJS.pad.ZeroPadding.pad(data, blockSize); + }, + + unpad: function (data) { + // Remove zero padding + CryptoJS.pad.ZeroPadding.unpad(data); + + // Remove one more byte -- the 0x80 byte + data.sigBytes--; + } +}; diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-nopadding-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-nopadding-min.js new file mode 100644 index 000000000..ab5d9d2e4 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-nopadding-min.js @@ -0,0 +1,7 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +CryptoJS.pad.NoPadding={pad:function(){},unpad:function(){}}; diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-nopadding.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-nopadding.js new file mode 100644 index 000000000..693b50418 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-nopadding.js @@ -0,0 +1,16 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +/** + * A noop padding strategy. + */ +CryptoJS.pad.NoPadding = { + pad: function () { + }, + + unpad: function () { + } +}; diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-zeropadding-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-zeropadding-min.js new file mode 100644 index 000000000..617098fc7 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-zeropadding-min.js @@ -0,0 +1,7 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +CryptoJS.pad.ZeroPadding={pad:function(a,c){var b=4*c;a.clamp();a.sigBytes+=b-(a.sigBytes%b||b)},unpad:function(a){for(var c=a.words,b=a.sigBytes-1;!(c[b>>>2]>>>24-8*(b%4)&255);)b--;a.sigBytes=b+1}}; diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-zeropadding.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-zeropadding.js new file mode 100644 index 000000000..81a41bf16 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pad-zeropadding.js @@ -0,0 +1,31 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +/** + * Zero padding strategy. + */ +CryptoJS.pad.ZeroPadding = { + pad: function (data, blockSize) { + // Shortcut + var blockSizeBytes = blockSize * 4; + + // Pad + data.clamp(); + data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes); + }, + + unpad: function (data) { + // Shortcut + var dataWords = data.words; + + // Unpad + var i = data.sigBytes - 1; + while (!((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) { + i--; + } + data.sigBytes = i + 1; + } +}; diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pbkdf2-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pbkdf2-min.js new file mode 100644 index 000000000..a16bc4a4b --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/pbkdf2-min.js @@ -0,0 +1,8 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function(){var b=CryptoJS,a=b.lib,d=a.Base,l=a.WordArray,a=b.algo,o=a.HMAC,k=a.PBKDF2=d.extend({cfg:d.extend({keySize:4,hasher:a.SHA1,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,f=o.create(c.hasher,a),g=l.create(),d=l.create([1]),k=g.words,p=d.words,m=c.keySize,c=c.iterations;k.lengthc;c++)f[c]=d[c];d[0]=d[0]+1295307597+this._b|0;d[1]=d[1]+3545052371+(d[0]>>>0>>0?1:0)|0;d[2]=d[2]+886263092+(d[1]>>>0>>0?1:0)|0;d[3]=d[3]+1295307597+(d[2]>>>0>>0?1:0)|0;d[4]=d[4]+3545052371+(d[3]>>>0>>0?1:0)|0;d[5]=d[5]+886263092+(d[4]>>>0>>0?1:0)|0;d[6]=d[6]+1295307597+(d[5]>>>0>>0?1:0)|0;d[7]=d[7]+3545052371+(d[6]>>>0>>0?1:0)|0;this._b=d[7]>>>0>>0?1:0;for(c=0;8>c;c++){var h=a[c]+d[c],e=h&65535, +g=h>>>16;b[c]=((e*e>>>17)+e*g>>>15)+g*g^((h&4294901760)*h|0)+((h&65535)*h|0)}a[0]=b[0]+(b[7]<<16|b[7]>>>16)+(b[6]<<16|b[6]>>>16)|0;a[1]=b[1]+(b[0]<<8|b[0]>>>24)+b[7]|0;a[2]=b[2]+(b[1]<<16|b[1]>>>16)+(b[0]<<16|b[0]>>>16)|0;a[3]=b[3]+(b[2]<<8|b[2]>>>24)+b[1]|0;a[4]=b[4]+(b[3]<<16|b[3]>>>16)+(b[2]<<16|b[2]>>>16)|0;a[5]=b[5]+(b[4]<<8|b[4]>>>24)+b[3]|0;a[6]=b[6]+(b[5]<<16|b[5]>>>16)+(b[4]<<16|b[4]>>>16)|0;a[7]=b[7]+(b[6]<<8|b[6]>>>24)+b[5]|0}var i=CryptoJS,j=i.lib.StreamCipher,e=[],f=[],b=[],k=i.algo.Rabbit= +j.extend({_doReset:function(){for(var a=this._key.words,d=this.cfg.iv,c=this._X=[a[0],a[3]<<16|a[2]>>>16,a[1],a[0]<<16|a[3]>>>16,a[2],a[1]<<16|a[0]>>>16,a[3],a[2]<<16|a[1]>>>16],a=this._C=[a[2]<<16|a[2]>>>16,a[0]&4294901760|a[1]&65535,a[3]<<16|a[3]>>>16,a[1]&4294901760|a[2]&65535,a[0]<<16|a[0]>>>16,a[2]&4294901760|a[3]&65535,a[1]<<16|a[1]>>>16,a[3]&4294901760|a[0]&65535],b=this._b=0;4>b;b++)g.call(this);for(b=0;8>b;b++)a[b]^=c[b+4&7];if(d){var c=d.words,d=c[0],c=c[1],d=(d<<8|d>>>24)&16711935|(d<< +24|d>>>8)&4278255360,c=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360,b=d>>>16|c&4294901760,e=c<<16|d&65535;a[0]^=d;a[1]^=b;a[2]^=c;a[3]^=e;a[4]^=d;a[5]^=b;a[6]^=c;a[7]^=e;for(b=0;4>b;b++)g.call(this)}},_doProcessBlock:function(a,b){var c=this._X;g.call(this);e[0]=c[0]^c[5]>>>16^c[3]<<16;e[1]=c[2]^c[7]>>>16^c[5]<<16;e[2]=c[4]^c[1]>>>16^c[7]<<16;e[3]=c[6]^c[3]>>>16^c[1]<<16;for(c=0;4>c;c++)e[c]=(e[c]<<8|e[c]>>>24)&16711935|(e[c]<<24|e[c]>>>8)&4278255360,a[b+c]^=e[c]},blockSize:4,ivSize:2});i.Rabbit= +j._createHelper(k)})(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/rabbit.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/rabbit.js new file mode 100644 index 000000000..9f8979546 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/rabbit.js @@ -0,0 +1,172 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + + // Reusable objects + var S = []; + var C_ = []; + var G = []; + + /** + * Rabbit stream cipher algorithm + */ + var Rabbit = C_algo.Rabbit = StreamCipher.extend({ + _doReset: function () { + // Shortcuts + var K = this._key.words; + var iv = this.cfg.iv; + + // Generate initial state values + var X = this._X = [ + K[0], (K[3] << 16) | (K[2] >>> 16), + K[1], (K[0] << 16) | (K[3] >>> 16), + K[2], (K[1] << 16) | (K[0] >>> 16), + K[3], (K[2] << 16) | (K[1] >>> 16) + ]; + + // Generate initial counter values + var C = this._C = [ + (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff), + (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff), + (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff), + (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff) + ]; + + // Carry bit + this._b = 0; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + + // Modify the counters + for (var i = 0; i < 8; i++) { + C[i] ^= X[(i + 4) & 7]; + } + + // IV setup + if (iv) { + // Shortcuts + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; + + // Generate four subvectors + var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00); + var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00); + var i1 = (i0 >>> 16) | (i2 & 0xffff0000); + var i3 = (i2 << 16) | (i0 & 0x0000ffff); + + // Modify counter values + C[0] ^= i0; + C[1] ^= i1; + C[2] ^= i2; + C[3] ^= i3; + C[4] ^= i0; + C[5] ^= i1; + C[6] ^= i2; + C[7] ^= i3; + + // Iterate the system four times + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var X = this._X; + + // Iterate the system + nextState.call(this); + + // Generate four keystream words + S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16); + S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16); + S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16); + S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16); + + for (var i = 0; i < 4; i++) { + // Swap endian + S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) | + (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00); + + // Encrypt + M[offset + i] ^= S[i]; + } + }, + + blockSize: 128/32, + + ivSize: 64/32 + }); + + function nextState() { + // Shortcuts + var X = this._X; + var C = this._C; + + // Save old counter values + for (var i = 0; i < 8; i++) { + C_[i] = C[i]; + } + + // Calculate new counter values + C[0] = (C[0] + 0x4d34d34d + this._b) | 0; + C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0; + C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0; + C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0; + C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0; + C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0; + C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0; + C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0; + this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0; + + // Calculate the g-values + for (var i = 0; i < 8; i++) { + var gx = X[i] + C[i]; + + // Construct high and low argument for squaring + var ga = gx & 0xffff; + var gb = gx >>> 16; + + // Calculate high and low result of squaring + var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb; + var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0); + + // High XOR low + G[i] = gh ^ gl; + } + + // Calculate new state values + X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0; + X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0; + X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0; + X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0; + X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0; + X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0; + X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0; + X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg); + * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg); + */ + C.Rabbit = StreamCipher._createHelper(Rabbit); +}()); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/rc4-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/rc4-min.js new file mode 100644 index 000000000..9dbac2a5e --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/rc4-min.js @@ -0,0 +1,8 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function(){function k(){for(var a=this._S,d=this._i,c=this._j,b=0,e=0;4>e;e++){var d=(d+1)%256,c=(c+a[d])%256,f=a[d];a[d]=a[c];a[c]=f;b|=a[(a[d]+a[c])%256]<<24-8*e}this._i=d;this._j=c;return b}var g=CryptoJS,j=g.lib.StreamCipher,h=g.algo,i=h.RC4=j.extend({_doReset:function(){for(var a=this._key,d=a.words,a=a.sigBytes,c=this._S=[],b=0;256>b;b++)c[b]=b;for(var e=b=0;256>b;b++){var f=b%a,e=(e+c[b]+(d[f>>>2]>>>24-8*(f%4)&255))%256,f=c[b];c[b]=c[e];c[e]=f}this._i=this._j=0},_doProcessBlock:function(a, +d){a[d]^=k.call(this)},keySize:8,ivSize:0});g.RC4=j._createHelper(i);h=h.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var a=this.cfg.drop;0>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff; + + j = (j + S[i] + keyByte) % 256; + + // Swap + var t = S[i]; + S[i] = S[j]; + S[j] = t; + } + + // Counters + this._i = this._j = 0; + }, + + _doProcessBlock: function (M, offset) { + M[offset] ^= generateKeystreamWord.call(this); + }, + + keySize: 256/32, + + ivSize: 0 + }); + + function generateKeystreamWord() { + // Shortcuts + var S = this._S; + var i = this._i; + var j = this._j; + + // Generate keystream word + var keystreamWord = 0; + for (var n = 0; n < 4; n++) { + i = (i + 1) % 256; + j = (j + S[i]) % 256; + + // Swap + var t = S[i]; + S[i] = S[j]; + S[j] = t; + + keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8); + } + + // Update counters + this._i = i; + this._j = j; + + return keystreamWord; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg); + */ + C.RC4 = StreamCipher._createHelper(RC4); + + /** + * Modified RC4 stream cipher algorithm. + */ + var RC4Drop = C_algo.RC4Drop = RC4.extend({ + /** + * Configuration options. + * + * @property {number} drop The number of keystream words to drop. Default 192 + */ + cfg: RC4.cfg.extend({ + drop: 192 + }), + + _doReset: function () { + RC4._doReset.call(this); + + // Drop + for (var i = this.cfg.drop; i > 0; i--) { + generateKeystreamWord.call(this); + } + } + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg); + * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg); + */ + C.RC4Drop = StreamCipher._createHelper(RC4Drop); +}()); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha1-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha1-min.js new file mode 100644 index 000000000..6d010bf99 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha1-min.js @@ -0,0 +1,8 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function(){var d=CryptoJS,c=d.lib,l=c.WordArray,c=c.Hasher,j=[],k=d.algo.SHA1=c.extend({_doReset:function(){this._hash=l.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(c,m){for(var a=this._hash.words,e=a[0],f=a[1],h=a[2],i=a[3],d=a[4],b=0;80>b;b++){if(16>b)j[b]=c[m+b]|0;else{var g=j[b-3]^j[b-8]^j[b-14]^j[b-16];j[b]=g<<1|g>>>31}g=(e<<5|e>>>27)+d+j[b];g=20>b?g+((f&h|~f&i)+1518500249):40>b?g+((f^h^i)+1859775393):60>b?g+((f&h|f&i|h&i)-1894007588):g+((f^h^i)- +899497514);d=i;i=h;h=f<<30|f>>>2;f=e;e=g}a[0]=a[0]+e|0;a[1]=a[1]+f|0;a[2]=a[2]+h|0;a[3]=a[3]+i|0;a[4]=a[4]+d|0},_doFinalize:function(){var d=this._data,c=d.words,a=8*this._nDataBytes,e=8*d.sigBytes;c[e>>>5]|=128<<24-e%32;c[(e+64>>>9<<4)+15]=a;d.sigBytes=4*c.length;this._process()}});d.SHA1=c._createHelper(k);d.HmacSHA1=c._createHmacHelper(k)})(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha1.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha1.js new file mode 100644 index 000000000..ae8ea8187 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha1.js @@ -0,0 +1,125 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Reusable object + var W = []; + + /** + * SHA-1 hash algorithm. + */ + var SHA1 = C_algo.SHA1 = Hasher.extend({ + _doReset: function () { + this._hash = WordArray.create([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476, + 0xc3d2e1f0 + ]); + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + + // Computation + for (var i = 0; i < 80; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; + W[i] = (n << 1) | (n >>> 31); + } + + var t = ((a << 5) | (a >>> 27)) + e + W[i]; + if (i < 20) { + t += ((b & c) | (~b & d)) + 0x5a827999; + } else if (i < 40) { + t += (b ^ c ^ d) + 0x6ed9eba1; + } else if (i < 60) { + t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; + } else /* if (i < 80) */ { + t += (b ^ c ^ d) - 0x359d3e2a; + } + + e = d; + d = c; + c = (b << 30) | (b >>> 2); + b = a; + a = t; + } + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA1('message'); + * var hash = CryptoJS.SHA1(wordArray); + */ + C.SHA1 = Hasher._createHelper(SHA1); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA1(message, key); + */ + C.HmacSHA1 = Hasher._createHmacHelper(SHA1); +}()); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha224-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha224-min.js new file mode 100644 index 000000000..abf0f262a --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha224-min.js @@ -0,0 +1,7 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function(){var b=CryptoJS,d=b.lib.WordArray,a=b.algo,c=a.SHA256,a=a.SHA224=c.extend({_doReset:function(){this._hash=d.create([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){c._doFinalize.call(this);this._hash.sigBytes-=4}});b.SHA224=c._createHelper(a);b.HmacSHA224=c._createHmacHelper(a)})(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha224.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha224.js new file mode 100644 index 000000000..c1c33f576 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha224.js @@ -0,0 +1,64 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var SHA256 = C_algo.SHA256; + + /** + * SHA-224 hash algorithm. + */ + var SHA224 = C_algo.SHA224 = SHA256.extend({ + _doReset: function () { + this._hash = WordArray.create([ + 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, + 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 + ]); + }, + + _doFinalize: function () { + SHA256._doFinalize.call(this); + + this._hash.sigBytes -= 4; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA224('message'); + * var hash = CryptoJS.SHA224(wordArray); + */ + C.SHA224 = SHA256._createHelper(SHA224); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA224(message, key); + */ + C.HmacSHA224 = SHA256._createHmacHelper(SHA224); +}()); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha256-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha256-min.js new file mode 100644 index 000000000..b4cc66e3f --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha256-min.js @@ -0,0 +1,9 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function(k){var h=CryptoJS,i=h.lib,r=i.WordArray,i=i.Hasher,c=h.algo,p=[],q=[];(function(){function g(a){for(var b=k.sqrt(a),d=2;d<=b;d++)if(!(a%d))return!1;return!0}function d(a){return 4294967296*(a-(a|0))|0}for(var a=2,b=0;64>b;)g(a)&&(8>b&&(p[b]=d(k.pow(a,0.5))),q[b]=d(k.pow(a,1/3)),b++),a++})();var g=[],c=c.SHA256=i.extend({_doReset:function(){this._hash=r.create(p.slice(0))},_doProcessBlock:function(i,d){for(var a=this._hash.words,b=a[0],m=a[1],n=a[2],h=a[3],f=a[4],c=a[5],o=a[6],k=a[7],e=0;64> +e;e++){if(16>e)g[e]=i[d+e]|0;else{var j=g[e-15],l=g[e-2];g[e]=((j<<25|j>>>7)^(j<<14|j>>>18)^j>>>3)+g[e-7]+((l<<15|l>>>17)^(l<<13|l>>>19)^l>>>10)+g[e-16]}j=k+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&c^~f&o)+q[e]+g[e];l=((b<<30|b>>>2)^(b<<19|b>>>13)^(b<<10|b>>>22))+(b&m^b&n^m&n);k=o;o=c;c=f;f=h+j|0;h=n;n=m;m=b;b=j+l|0}a[0]=a[0]+b|0;a[1]=a[1]+m|0;a[2]=a[2]+n|0;a[3]=a[3]+h|0;a[4]=a[4]+f|0;a[5]=a[5]+c|0;a[6]=a[6]+o|0;a[7]=a[7]+k|0},_doFinalize:function(){var c=this._data,d=c.words,a=8*this._nDataBytes, +b=8*c.sigBytes;d[b>>>5]|=128<<24-b%32;d[(b+64>>>9<<4)+15]=a;c.sigBytes=4*d.length;this._process()}});h.SHA256=i._createHelper(c);h.HmacSHA256=i._createHmacHelper(c)})(Math); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha256.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha256.js new file mode 100644 index 000000000..deb520f65 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha256.js @@ -0,0 +1,174 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function (Math) { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Initialization and round constants tables + var H = []; + var K = []; + + // Compute constants + (function () { + function isPrime(n) { + var sqrtN = Math.sqrt(n); + for (var factor = 2; factor <= sqrtN; factor++) { + if (!(n % factor)) { + return false; + } + } + + return true; + } + + function getFractionalBits(n) { + return ((n - (n | 0)) * 0x100000000) | 0; + } + + var n = 2; + var nPrime = 0; + while (nPrime < 64) { + if (isPrime(n)) { + if (nPrime < 8) { + H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2)); + } + K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3)); + + nPrime++; + } + + n++; + } + }()); + + // Reusable object + var W = []; + + /** + * SHA-256 hash algorithm. + */ + var SHA256 = C_algo.SHA256 = Hasher.extend({ + _doReset: function () { + this._hash = WordArray.create(H.slice(0)); + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + var f = H[5]; + var g = H[6]; + var h = H[7]; + + // Computation + for (var i = 0; i < 64; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var gamma0x = W[i - 15]; + var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^ + ((gamma0x << 14) | (gamma0x >>> 18)) ^ + (gamma0x >>> 3); + + var gamma1x = W[i - 2]; + var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^ + ((gamma1x << 13) | (gamma1x >>> 19)) ^ + (gamma1x >>> 10); + + W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; + } + + var ch = (e & f) ^ (~e & g); + var maj = (a & b) ^ (a & c) ^ (b & c); + + var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22)); + var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25)); + + var t1 = h + sigma1 + ch + K[i] + W[i]; + var t2 = sigma0 + maj; + + h = g; + g = f; + f = e; + e = (d + t1) | 0; + d = c; + c = b; + b = a; + a = (t1 + t2) | 0; + } + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + H[5] = (H[5] + f) | 0; + H[6] = (H[6] + g) | 0; + H[7] = (H[7] + h) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA256('message'); + * var hash = CryptoJS.SHA256(wordArray); + */ + C.SHA256 = Hasher._createHelper(SHA256); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA256(message, key); + */ + C.HmacSHA256 = Hasher._createHmacHelper(SHA256); +}(Math)); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha384-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha384-min.js new file mode 100644 index 000000000..0e9f9e40b --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha384-min.js @@ -0,0 +1,8 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function(){var c=CryptoJS,a=c.x64,b=a.Word,e=a.WordArray,a=c.algo,d=a.SHA512,a=a.SHA384=d.extend({_doReset:function(){this._hash=e.create([b.create(3418070365,3238371032),b.create(1654270250,914150663),b.create(2438529370,812702999),b.create(355462360,4144912697),b.create(1731405415,4290775857),b.create(2394180231,1750603025),b.create(3675008525,1694076839),b.create(1203062813,3204075428)])},_doFinalize:function(){d._doFinalize.call(this);this._hash.sigBytes-=16}});c.SHA384=d._createHelper(a);c.HmacSHA384= +d._createHmacHelper(a)})(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha384.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha384.js new file mode 100644 index 000000000..45668f146 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha384.js @@ -0,0 +1,67 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function () { + // Shortcuts + var C = CryptoJS; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + var SHA512 = C_algo.SHA512; + + /** + * SHA-384 hash algorithm. + */ + var SHA384 = C_algo.SHA384 = SHA512.extend({ + _doReset: function () { + this._hash = X64WordArray.create([ + X64Word.create(0xcbbb9d5d, 0xc1059ed8), X64Word.create(0x629a292a, 0x367cd507), + X64Word.create(0x9159015a, 0x3070dd17), X64Word.create(0x152fecd8, 0xf70e5939), + X64Word.create(0x67332667, 0xffc00b31), X64Word.create(0x8eb44a87, 0x68581511), + X64Word.create(0xdb0c2e0d, 0x64f98fa7), X64Word.create(0x47b5481d, 0xbefa4fa4) + ]); + }, + + _doFinalize: function () { + SHA512._doFinalize.call(this); + + this._hash.sigBytes -= 16; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA384('message'); + * var hash = CryptoJS.SHA384(wordArray); + */ + C.SHA384 = SHA512._createHelper(SHA384); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA384(message, key); + */ + C.HmacSHA384 = SHA512._createHmacHelper(SHA384); +}()); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha512-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha512-min.js new file mode 100644 index 000000000..fb62614c4 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha512-min.js @@ -0,0 +1,15 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function(){function a(){return v.create.apply(v,arguments)}var d=CryptoJS,r=d.lib.Hasher,e=d.x64,v=e.Word,S=e.WordArray,e=d.algo,da=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317), +a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291, +2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899), +a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470, +3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],s=[];(function(){for(var T=0;80>T;T++)s[T]=a()})();e=e.SHA512=r.extend({_doReset:function(){this._hash=S.create([a(1779033703,4089235720),a(3144134277,2227873595),a(1013904242,4271175723),a(2773480762,1595750129),a(1359893119,2917565137),a(2600822924,725511199),a(528734635,4215389547),a(1541459225,327033209)])},_doProcessBlock:function(a,e){for(var f=this._hash.words,C=f[0],d=f[1],D=f[2],E=f[3],F=f[4],G=f[5],H= +f[6],f=f[7],r=C.high,I=C.low,v=d.high,J=d.low,X=D.high,K=D.low,Y=E.high,L=E.low,Z=F.high,M=F.low,$=G.high,N=G.low,aa=H.high,O=H.low,ba=f.high,P=f.low,j=r,g=I,w=v,t=J,x=X,u=K,U=Y,y=L,k=Z,h=M,Q=$,z=N,R=aa,A=O,V=ba,B=P,l=0;80>l;l++){var o=s[l];if(16>l)var i=o.high=a[e+2*l]|0,b=o.low=a[e+2*l+1]|0;else{var i=s[l-15],b=i.high,m=i.low,i=(b>>>1|m<<31)^(b>>>8|m<<24)^b>>>7,m=(m>>>1|b<<31)^(m>>>8|b<<24)^(m>>>7|b<<25),q=s[l-2],b=q.high,c=q.low,q=(b>>>19|c<<13)^(b<<3|c>>>29)^b>>>6,c=(c>>>19|b<<13)^(c<<3|b>>>29)^ +(c>>>6|b<<26),b=s[l-7],W=b.high,p=s[l-16],n=p.high,p=p.low,b=m+b.low,i=i+W+(b>>>0>>0?1:0),b=b+c,i=i+q+(b>>>0>>0?1:0),b=b+p,i=i+n+(b>>>0

>>0?1:0);o.high=i;o.low=b}var W=k&Q^~k&R,p=h&z^~h&A,o=j&w^j&x^w&x,S=g&t^g&u^t&u,m=(j>>>28|g<<4)^(j<<30|g>>>2)^(j<<25|g>>>7),q=(g>>>28|j<<4)^(g<<30|j>>>2)^(g<<25|j>>>7),c=da[l],ea=c.high,ca=c.low,c=B+((h>>>14|k<<18)^(h>>>18|k<<14)^(h<<23|k>>>9)),n=V+((k>>>14|h<<18)^(k>>>18|h<<14)^(k<<23|h>>>9))+(c>>>0>>0?1:0),c=c+p,n=n+W+(c>>>0

>>0?1:0),c=c+ca,n=n+ea+ +(c>>>0>>0?1:0),c=c+b,n=n+i+(c>>>0>>0?1:0),b=q+S,o=m+o+(b>>>0>>0?1:0),V=R,B=A,R=Q,A=z,Q=k,z=h,h=y+c|0,k=U+n+(h>>>0>>0?1:0)|0,U=x,y=u,x=w,u=t,w=j,t=g,g=c+b|0,j=n+o+(g>>>0>>0?1:0)|0}I=C.low=I+g;C.high=r+j+(I>>>0>>0?1:0);J=d.low=J+t;d.high=v+w+(J>>>0>>0?1:0);K=D.low=K+u;D.high=X+x+(K>>>0>>0?1:0);L=E.low=L+y;E.high=Y+U+(L>>>0>>0?1:0);M=F.low=M+h;F.high=Z+k+(M>>>0>>0?1:0);N=G.low=N+z;G.high=$+Q+(N>>>0>>0?1:0);O=H.low=O+A;H.high=aa+R+(O>>>0>>0?1:0);P=f.low=P+B;f.high= +ba+V+(P>>>0>>0?1:0)},_doFinalize:function(){var a=this._data,d=a.words,f=8*this._nDataBytes,e=8*a.sigBytes;d[e>>>5]|=128<<24-e%32;d[(e+128>>>10<<5)+31]=f;a.sigBytes=4*d.length;this._process();this._hash=this._hash.toX32()},blockSize:32});d.SHA512=r._createHelper(e);d.HmacSHA512=r._createHmacHelper(e)})(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha512.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha512.js new file mode 100644 index 000000000..afae5e909 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/sha512.js @@ -0,0 +1,298 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + + function X64Word_create() { + return X64Word.create.apply(X64Word, arguments); + } + + // Constants + var K = [ + X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), + X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), + X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), + X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), + X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), + X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), + X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), + X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), + X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), + X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), + X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), + X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), + X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), + X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), + X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), + X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), + X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), + X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), + X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), + X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), + X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), + X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), + X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), + X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), + X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), + X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), + X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), + X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), + X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), + X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), + X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), + X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), + X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), + X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), + X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), + X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), + X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), + X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), + X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), + X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817) + ]; + + // Reusable objects + var W = []; + (function () { + for (var i = 0; i < 80; i++) { + W[i] = X64Word_create(); + } + }()); + + /** + * SHA-512 hash algorithm. + */ + var SHA512 = C_algo.SHA512 = Hasher.extend({ + _doReset: function () { + this._hash = X64WordArray.create([ + X64Word_create(0x6a09e667, 0xf3bcc908), X64Word_create(0xbb67ae85, 0x84caa73b), + X64Word_create(0x3c6ef372, 0xfe94f82b), X64Word_create(0xa54ff53a, 0x5f1d36f1), + X64Word_create(0x510e527f, 0xade682d1), X64Word_create(0x9b05688c, 0x2b3e6c1f), + X64Word_create(0x1f83d9ab, 0xfb41bd6b), X64Word_create(0x5be0cd19, 0x137e2179) + ]); + }, + + _doProcessBlock: function (M, offset) { + // Shortcuts + var H = this._hash.words; + + var H0 = H[0]; + var H1 = H[1]; + var H2 = H[2]; + var H3 = H[3]; + var H4 = H[4]; + var H5 = H[5]; + var H6 = H[6]; + var H7 = H[7]; + + var H0h = H0.high; + var H0l = H0.low; + var H1h = H1.high; + var H1l = H1.low; + var H2h = H2.high; + var H2l = H2.low; + var H3h = H3.high; + var H3l = H3.low; + var H4h = H4.high; + var H4l = H4.low; + var H5h = H5.high; + var H5l = H5.low; + var H6h = H6.high; + var H6l = H6.low; + var H7h = H7.high; + var H7l = H7.low; + + // Working variables + var ah = H0h; + var al = H0l; + var bh = H1h; + var bl = H1l; + var ch = H2h; + var cl = H2l; + var dh = H3h; + var dl = H3l; + var eh = H4h; + var el = H4l; + var fh = H5h; + var fl = H5l; + var gh = H6h; + var gl = H6l; + var hh = H7h; + var hl = H7l; + + // Rounds + for (var i = 0; i < 80; i++) { + // Shortcut + var Wi = W[i]; + + // Extend message + if (i < 16) { + var Wih = Wi.high = M[offset + i * 2] | 0; + var Wil = Wi.low = M[offset + i * 2 + 1] | 0; + } else { + // Gamma0 + var gamma0x = W[i - 15]; + var gamma0xh = gamma0x.high; + var gamma0xl = gamma0x.low; + var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7); + var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25)); + + // Gamma1 + var gamma1x = W[i - 2]; + var gamma1xh = gamma1x.high; + var gamma1xl = gamma1x.low; + var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6); + var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26)); + + // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] + var Wi7 = W[i - 7]; + var Wi7h = Wi7.high; + var Wi7l = Wi7.low; + + var Wi16 = W[i - 16]; + var Wi16h = Wi16.high; + var Wi16l = Wi16.low; + + var Wil = gamma0l + Wi7l; + var Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0); + var Wil = Wil + gamma1l; + var Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0); + var Wil = Wil + Wi16l; + var Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0); + + Wi.high = Wih; + Wi.low = Wil; + } + + var chh = (eh & fh) ^ (~eh & gh); + var chl = (el & fl) ^ (~el & gl); + var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); + var majl = (al & bl) ^ (al & cl) ^ (bl & cl); + + var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); + var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); + var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9)); + var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)); + + // t1 = h + sigma1 + ch + K[i] + W[i] + var Ki = K[i]; + var Kih = Ki.high; + var Kil = Ki.low; + + var t1l = hl + sigma1l; + var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); + var t1l = t1l + chl; + var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); + var t1l = t1l + Kil; + var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0); + var t1l = t1l + Wil; + var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0); + + // t2 = sigma0 + maj + var t2l = sigma0l + majl; + var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); + + // Update working variables + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + el = (dl + t1l) | 0; + eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + al = (t1l + t2l) | 0; + ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; + } + + // Intermediate hash value + H0l = H0.low = (H0l + al); + H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)); + H1l = H1.low = (H1l + bl); + H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)); + H2l = H2.low = (H2l + cl); + H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)); + H3l = H3.low = (H3l + dl); + H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)); + H4l = H4.low = (H4l + el); + H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)); + H5l = H5.low = (H5l + fl); + H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)); + H6l = H6.low = (H6l + gl); + H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)); + H7l = H7.low = (H7l + hl); + H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)); + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Convert hash to 32-bit word array before returning + this._hash = this._hash.toX32(); + }, + + blockSize: 1024/32 + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA512('message'); + * var hash = CryptoJS.SHA512(wordArray); + */ + C.SHA512 = Hasher._createHelper(SHA512); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA512(message, key); + */ + C.HmacSHA512 = Hasher._createHmacHelper(SHA512); +}()); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/tripledes-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/tripledes-min.js new file mode 100644 index 000000000..e0710129a --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/tripledes-min.js @@ -0,0 +1,26 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function(){function i(b,c){var a=(this._lBlock>>>b^this._rBlock)&c;this._rBlock^=a;this._lBlock^=a<>>b^this._lBlock)&c;this._lBlock^=a;this._rBlock^=a<a;a++){var f=o[a]-1;c[a]=b[f>>>5]>>>31-f%32&1}b=this._subKeys=[];for(f=0;16>f;f++){for(var d=b[f]=[],e=p[f],a=0;24>a;a++)d[a/6|0]|=c[(n[a]-1+e)%28]<<31-a%6,d[4+(a/6|0)]|=c[28+(n[a+24]-1+e)%28]<<31-a%6;d[0]=d[0]<<1|d[0]>>>31;for(a=1;7>a;a++)d[a]>>>= +4*(a-1)+3;d[7]=d[7]<<5|d[7]>>>27}c=this._invSubKeys=[];for(a=0;16>a;a++)c[a]=b[15-a]},encryptBlock:function(b,c){this._doCryptBlock(b,c,this._subKeys)},decryptBlock:function(b,c){this._doCryptBlock(b,c,this._invSubKeys)},_doCryptBlock:function(b,c,a){this._lBlock=b[c];this._rBlock=b[c+1];i.call(this,4,252645135);i.call(this,16,65535);k.call(this,2,858993459);k.call(this,8,16711935);i.call(this,1,1431655765);for(var f=0;16>f;f++){for(var d=a[f],e=this._lBlock,h=this._rBlock,g=0,j=0;8>j;j++)g|=q[j][((h^ +d[j])&r[j])>>>0];this._lBlock=h;this._rBlock=e^g}a=this._lBlock;this._lBlock=this._rBlock;this._rBlock=a;i.call(this,1,1431655765);k.call(this,8,16711935);k.call(this,2,858993459);i.call(this,16,65535);i.call(this,4,252645135);b[c]=this._lBlock;b[c+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});h.DES=e._createHelper(l);g=g.TripleDES=e.extend({_doReset:function(){var b=this._key.words;this._des1=l.createEncryptor(m.create(b.slice(0,2)));this._des2=l.createEncryptor(m.create(b.slice(2,4)));this._des3= +l.createEncryptor(m.create(b.slice(4,6)))},encryptBlock:function(b,c){this._des1.encryptBlock(b,c);this._des2.decryptBlock(b,c);this._des3.encryptBlock(b,c)},decryptBlock:function(b,c){this._des3.decryptBlock(b,c);this._des2.encryptBlock(b,c);this._des1.decryptBlock(b,c)},keySize:6,ivSize:2,blockSize:2});h.TripleDES=e._createHelper(g)})(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/tripledes.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/tripledes.js new file mode 100644 index 000000000..05acb7d87 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/tripledes.js @@ -0,0 +1,756 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + + // Permuted Choice 1 constants + var PC1 = [ + 57, 49, 41, 33, 25, 17, 9, 1, + 58, 50, 42, 34, 26, 18, 10, 2, + 59, 51, 43, 35, 27, 19, 11, 3, + 60, 52, 44, 36, 63, 55, 47, 39, + 31, 23, 15, 7, 62, 54, 46, 38, + 30, 22, 14, 6, 61, 53, 45, 37, + 29, 21, 13, 5, 28, 20, 12, 4 + ]; + + // Permuted Choice 2 constants + var PC2 = [ + 14, 17, 11, 24, 1, 5, + 3, 28, 15, 6, 21, 10, + 23, 19, 12, 4, 26, 8, + 16, 7, 27, 20, 13, 2, + 41, 52, 31, 37, 47, 55, + 30, 40, 51, 45, 33, 48, + 44, 49, 39, 56, 34, 53, + 46, 42, 50, 36, 29, 32 + ]; + + // Cumulative bit shift constants + var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; + + // SBOXes and round permutation constants + var SBOX_P = [ + { + 0x0: 0x808200, + 0x10000000: 0x8000, + 0x20000000: 0x808002, + 0x30000000: 0x2, + 0x40000000: 0x200, + 0x50000000: 0x808202, + 0x60000000: 0x800202, + 0x70000000: 0x800000, + 0x80000000: 0x202, + 0x90000000: 0x800200, + 0xa0000000: 0x8200, + 0xb0000000: 0x808000, + 0xc0000000: 0x8002, + 0xd0000000: 0x800002, + 0xe0000000: 0x0, + 0xf0000000: 0x8202, + 0x8000000: 0x0, + 0x18000000: 0x808202, + 0x28000000: 0x8202, + 0x38000000: 0x8000, + 0x48000000: 0x808200, + 0x58000000: 0x200, + 0x68000000: 0x808002, + 0x78000000: 0x2, + 0x88000000: 0x800200, + 0x98000000: 0x8200, + 0xa8000000: 0x808000, + 0xb8000000: 0x800202, + 0xc8000000: 0x800002, + 0xd8000000: 0x8002, + 0xe8000000: 0x202, + 0xf8000000: 0x800000, + 0x1: 0x8000, + 0x10000001: 0x2, + 0x20000001: 0x808200, + 0x30000001: 0x800000, + 0x40000001: 0x808002, + 0x50000001: 0x8200, + 0x60000001: 0x200, + 0x70000001: 0x800202, + 0x80000001: 0x808202, + 0x90000001: 0x808000, + 0xa0000001: 0x800002, + 0xb0000001: 0x8202, + 0xc0000001: 0x202, + 0xd0000001: 0x800200, + 0xe0000001: 0x8002, + 0xf0000001: 0x0, + 0x8000001: 0x808202, + 0x18000001: 0x808000, + 0x28000001: 0x800000, + 0x38000001: 0x200, + 0x48000001: 0x8000, + 0x58000001: 0x800002, + 0x68000001: 0x2, + 0x78000001: 0x8202, + 0x88000001: 0x8002, + 0x98000001: 0x800202, + 0xa8000001: 0x202, + 0xb8000001: 0x808200, + 0xc8000001: 0x800200, + 0xd8000001: 0x0, + 0xe8000001: 0x8200, + 0xf8000001: 0x808002 + }, + { + 0x0: 0x40084010, + 0x1000000: 0x4000, + 0x2000000: 0x80000, + 0x3000000: 0x40080010, + 0x4000000: 0x40000010, + 0x5000000: 0x40084000, + 0x6000000: 0x40004000, + 0x7000000: 0x10, + 0x8000000: 0x84000, + 0x9000000: 0x40004010, + 0xa000000: 0x40000000, + 0xb000000: 0x84010, + 0xc000000: 0x80010, + 0xd000000: 0x0, + 0xe000000: 0x4010, + 0xf000000: 0x40080000, + 0x800000: 0x40004000, + 0x1800000: 0x84010, + 0x2800000: 0x10, + 0x3800000: 0x40004010, + 0x4800000: 0x40084010, + 0x5800000: 0x40000000, + 0x6800000: 0x80000, + 0x7800000: 0x40080010, + 0x8800000: 0x80010, + 0x9800000: 0x0, + 0xa800000: 0x4000, + 0xb800000: 0x40080000, + 0xc800000: 0x40000010, + 0xd800000: 0x84000, + 0xe800000: 0x40084000, + 0xf800000: 0x4010, + 0x10000000: 0x0, + 0x11000000: 0x40080010, + 0x12000000: 0x40004010, + 0x13000000: 0x40084000, + 0x14000000: 0x40080000, + 0x15000000: 0x10, + 0x16000000: 0x84010, + 0x17000000: 0x4000, + 0x18000000: 0x4010, + 0x19000000: 0x80000, + 0x1a000000: 0x80010, + 0x1b000000: 0x40000010, + 0x1c000000: 0x84000, + 0x1d000000: 0x40004000, + 0x1e000000: 0x40000000, + 0x1f000000: 0x40084010, + 0x10800000: 0x84010, + 0x11800000: 0x80000, + 0x12800000: 0x40080000, + 0x13800000: 0x4000, + 0x14800000: 0x40004000, + 0x15800000: 0x40084010, + 0x16800000: 0x10, + 0x17800000: 0x40000000, + 0x18800000: 0x40084000, + 0x19800000: 0x40000010, + 0x1a800000: 0x40004010, + 0x1b800000: 0x80010, + 0x1c800000: 0x0, + 0x1d800000: 0x4010, + 0x1e800000: 0x40080010, + 0x1f800000: 0x84000 + }, + { + 0x0: 0x104, + 0x100000: 0x0, + 0x200000: 0x4000100, + 0x300000: 0x10104, + 0x400000: 0x10004, + 0x500000: 0x4000004, + 0x600000: 0x4010104, + 0x700000: 0x4010000, + 0x800000: 0x4000000, + 0x900000: 0x4010100, + 0xa00000: 0x10100, + 0xb00000: 0x4010004, + 0xc00000: 0x4000104, + 0xd00000: 0x10000, + 0xe00000: 0x4, + 0xf00000: 0x100, + 0x80000: 0x4010100, + 0x180000: 0x4010004, + 0x280000: 0x0, + 0x380000: 0x4000100, + 0x480000: 0x4000004, + 0x580000: 0x10000, + 0x680000: 0x10004, + 0x780000: 0x104, + 0x880000: 0x4, + 0x980000: 0x100, + 0xa80000: 0x4010000, + 0xb80000: 0x10104, + 0xc80000: 0x10100, + 0xd80000: 0x4000104, + 0xe80000: 0x4010104, + 0xf80000: 0x4000000, + 0x1000000: 0x4010100, + 0x1100000: 0x10004, + 0x1200000: 0x10000, + 0x1300000: 0x4000100, + 0x1400000: 0x100, + 0x1500000: 0x4010104, + 0x1600000: 0x4000004, + 0x1700000: 0x0, + 0x1800000: 0x4000104, + 0x1900000: 0x4000000, + 0x1a00000: 0x4, + 0x1b00000: 0x10100, + 0x1c00000: 0x4010000, + 0x1d00000: 0x104, + 0x1e00000: 0x10104, + 0x1f00000: 0x4010004, + 0x1080000: 0x4000000, + 0x1180000: 0x104, + 0x1280000: 0x4010100, + 0x1380000: 0x0, + 0x1480000: 0x10004, + 0x1580000: 0x4000100, + 0x1680000: 0x100, + 0x1780000: 0x4010004, + 0x1880000: 0x10000, + 0x1980000: 0x4010104, + 0x1a80000: 0x10104, + 0x1b80000: 0x4000004, + 0x1c80000: 0x4000104, + 0x1d80000: 0x4010000, + 0x1e80000: 0x4, + 0x1f80000: 0x10100 + }, + { + 0x0: 0x80401000, + 0x10000: 0x80001040, + 0x20000: 0x401040, + 0x30000: 0x80400000, + 0x40000: 0x0, + 0x50000: 0x401000, + 0x60000: 0x80000040, + 0x70000: 0x400040, + 0x80000: 0x80000000, + 0x90000: 0x400000, + 0xa0000: 0x40, + 0xb0000: 0x80001000, + 0xc0000: 0x80400040, + 0xd0000: 0x1040, + 0xe0000: 0x1000, + 0xf0000: 0x80401040, + 0x8000: 0x80001040, + 0x18000: 0x40, + 0x28000: 0x80400040, + 0x38000: 0x80001000, + 0x48000: 0x401000, + 0x58000: 0x80401040, + 0x68000: 0x0, + 0x78000: 0x80400000, + 0x88000: 0x1000, + 0x98000: 0x80401000, + 0xa8000: 0x400000, + 0xb8000: 0x1040, + 0xc8000: 0x80000000, + 0xd8000: 0x400040, + 0xe8000: 0x401040, + 0xf8000: 0x80000040, + 0x100000: 0x400040, + 0x110000: 0x401000, + 0x120000: 0x80000040, + 0x130000: 0x0, + 0x140000: 0x1040, + 0x150000: 0x80400040, + 0x160000: 0x80401000, + 0x170000: 0x80001040, + 0x180000: 0x80401040, + 0x190000: 0x80000000, + 0x1a0000: 0x80400000, + 0x1b0000: 0x401040, + 0x1c0000: 0x80001000, + 0x1d0000: 0x400000, + 0x1e0000: 0x40, + 0x1f0000: 0x1000, + 0x108000: 0x80400000, + 0x118000: 0x80401040, + 0x128000: 0x0, + 0x138000: 0x401000, + 0x148000: 0x400040, + 0x158000: 0x80000000, + 0x168000: 0x80001040, + 0x178000: 0x40, + 0x188000: 0x80000040, + 0x198000: 0x1000, + 0x1a8000: 0x80001000, + 0x1b8000: 0x80400040, + 0x1c8000: 0x1040, + 0x1d8000: 0x80401000, + 0x1e8000: 0x400000, + 0x1f8000: 0x401040 + }, + { + 0x0: 0x80, + 0x1000: 0x1040000, + 0x2000: 0x40000, + 0x3000: 0x20000000, + 0x4000: 0x20040080, + 0x5000: 0x1000080, + 0x6000: 0x21000080, + 0x7000: 0x40080, + 0x8000: 0x1000000, + 0x9000: 0x20040000, + 0xa000: 0x20000080, + 0xb000: 0x21040080, + 0xc000: 0x21040000, + 0xd000: 0x0, + 0xe000: 0x1040080, + 0xf000: 0x21000000, + 0x800: 0x1040080, + 0x1800: 0x21000080, + 0x2800: 0x80, + 0x3800: 0x1040000, + 0x4800: 0x40000, + 0x5800: 0x20040080, + 0x6800: 0x21040000, + 0x7800: 0x20000000, + 0x8800: 0x20040000, + 0x9800: 0x0, + 0xa800: 0x21040080, + 0xb800: 0x1000080, + 0xc800: 0x20000080, + 0xd800: 0x21000000, + 0xe800: 0x1000000, + 0xf800: 0x40080, + 0x10000: 0x40000, + 0x11000: 0x80, + 0x12000: 0x20000000, + 0x13000: 0x21000080, + 0x14000: 0x1000080, + 0x15000: 0x21040000, + 0x16000: 0x20040080, + 0x17000: 0x1000000, + 0x18000: 0x21040080, + 0x19000: 0x21000000, + 0x1a000: 0x1040000, + 0x1b000: 0x20040000, + 0x1c000: 0x40080, + 0x1d000: 0x20000080, + 0x1e000: 0x0, + 0x1f000: 0x1040080, + 0x10800: 0x21000080, + 0x11800: 0x1000000, + 0x12800: 0x1040000, + 0x13800: 0x20040080, + 0x14800: 0x20000000, + 0x15800: 0x1040080, + 0x16800: 0x80, + 0x17800: 0x21040000, + 0x18800: 0x40080, + 0x19800: 0x21040080, + 0x1a800: 0x0, + 0x1b800: 0x21000000, + 0x1c800: 0x1000080, + 0x1d800: 0x40000, + 0x1e800: 0x20040000, + 0x1f800: 0x20000080 + }, + { + 0x0: 0x10000008, + 0x100: 0x2000, + 0x200: 0x10200000, + 0x300: 0x10202008, + 0x400: 0x10002000, + 0x500: 0x200000, + 0x600: 0x200008, + 0x700: 0x10000000, + 0x800: 0x0, + 0x900: 0x10002008, + 0xa00: 0x202000, + 0xb00: 0x8, + 0xc00: 0x10200008, + 0xd00: 0x202008, + 0xe00: 0x2008, + 0xf00: 0x10202000, + 0x80: 0x10200000, + 0x180: 0x10202008, + 0x280: 0x8, + 0x380: 0x200000, + 0x480: 0x202008, + 0x580: 0x10000008, + 0x680: 0x10002000, + 0x780: 0x2008, + 0x880: 0x200008, + 0x980: 0x2000, + 0xa80: 0x10002008, + 0xb80: 0x10200008, + 0xc80: 0x0, + 0xd80: 0x10202000, + 0xe80: 0x202000, + 0xf80: 0x10000000, + 0x1000: 0x10002000, + 0x1100: 0x10200008, + 0x1200: 0x10202008, + 0x1300: 0x2008, + 0x1400: 0x200000, + 0x1500: 0x10000000, + 0x1600: 0x10000008, + 0x1700: 0x202000, + 0x1800: 0x202008, + 0x1900: 0x0, + 0x1a00: 0x8, + 0x1b00: 0x10200000, + 0x1c00: 0x2000, + 0x1d00: 0x10002008, + 0x1e00: 0x10202000, + 0x1f00: 0x200008, + 0x1080: 0x8, + 0x1180: 0x202000, + 0x1280: 0x200000, + 0x1380: 0x10000008, + 0x1480: 0x10002000, + 0x1580: 0x2008, + 0x1680: 0x10202008, + 0x1780: 0x10200000, + 0x1880: 0x10202000, + 0x1980: 0x10200008, + 0x1a80: 0x2000, + 0x1b80: 0x202008, + 0x1c80: 0x200008, + 0x1d80: 0x0, + 0x1e80: 0x10000000, + 0x1f80: 0x10002008 + }, + { + 0x0: 0x100000, + 0x10: 0x2000401, + 0x20: 0x400, + 0x30: 0x100401, + 0x40: 0x2100401, + 0x50: 0x0, + 0x60: 0x1, + 0x70: 0x2100001, + 0x80: 0x2000400, + 0x90: 0x100001, + 0xa0: 0x2000001, + 0xb0: 0x2100400, + 0xc0: 0x2100000, + 0xd0: 0x401, + 0xe0: 0x100400, + 0xf0: 0x2000000, + 0x8: 0x2100001, + 0x18: 0x0, + 0x28: 0x2000401, + 0x38: 0x2100400, + 0x48: 0x100000, + 0x58: 0x2000001, + 0x68: 0x2000000, + 0x78: 0x401, + 0x88: 0x100401, + 0x98: 0x2000400, + 0xa8: 0x2100000, + 0xb8: 0x100001, + 0xc8: 0x400, + 0xd8: 0x2100401, + 0xe8: 0x1, + 0xf8: 0x100400, + 0x100: 0x2000000, + 0x110: 0x100000, + 0x120: 0x2000401, + 0x130: 0x2100001, + 0x140: 0x100001, + 0x150: 0x2000400, + 0x160: 0x2100400, + 0x170: 0x100401, + 0x180: 0x401, + 0x190: 0x2100401, + 0x1a0: 0x100400, + 0x1b0: 0x1, + 0x1c0: 0x0, + 0x1d0: 0x2100000, + 0x1e0: 0x2000001, + 0x1f0: 0x400, + 0x108: 0x100400, + 0x118: 0x2000401, + 0x128: 0x2100001, + 0x138: 0x1, + 0x148: 0x2000000, + 0x158: 0x100000, + 0x168: 0x401, + 0x178: 0x2100400, + 0x188: 0x2000001, + 0x198: 0x2100000, + 0x1a8: 0x0, + 0x1b8: 0x2100401, + 0x1c8: 0x100401, + 0x1d8: 0x400, + 0x1e8: 0x2000400, + 0x1f8: 0x100001 + }, + { + 0x0: 0x8000820, + 0x1: 0x20000, + 0x2: 0x8000000, + 0x3: 0x20, + 0x4: 0x20020, + 0x5: 0x8020820, + 0x6: 0x8020800, + 0x7: 0x800, + 0x8: 0x8020000, + 0x9: 0x8000800, + 0xa: 0x20800, + 0xb: 0x8020020, + 0xc: 0x820, + 0xd: 0x0, + 0xe: 0x8000020, + 0xf: 0x20820, + 0x80000000: 0x800, + 0x80000001: 0x8020820, + 0x80000002: 0x8000820, + 0x80000003: 0x8000000, + 0x80000004: 0x8020000, + 0x80000005: 0x20800, + 0x80000006: 0x20820, + 0x80000007: 0x20, + 0x80000008: 0x8000020, + 0x80000009: 0x820, + 0x8000000a: 0x20020, + 0x8000000b: 0x8020800, + 0x8000000c: 0x0, + 0x8000000d: 0x8020020, + 0x8000000e: 0x8000800, + 0x8000000f: 0x20000, + 0x10: 0x20820, + 0x11: 0x8020800, + 0x12: 0x20, + 0x13: 0x800, + 0x14: 0x8000800, + 0x15: 0x8000020, + 0x16: 0x8020020, + 0x17: 0x20000, + 0x18: 0x0, + 0x19: 0x20020, + 0x1a: 0x8020000, + 0x1b: 0x8000820, + 0x1c: 0x8020820, + 0x1d: 0x20800, + 0x1e: 0x820, + 0x1f: 0x8000000, + 0x80000010: 0x20000, + 0x80000011: 0x800, + 0x80000012: 0x8020020, + 0x80000013: 0x20820, + 0x80000014: 0x20, + 0x80000015: 0x8020000, + 0x80000016: 0x8000000, + 0x80000017: 0x8000820, + 0x80000018: 0x8020820, + 0x80000019: 0x8000020, + 0x8000001a: 0x8000800, + 0x8000001b: 0x0, + 0x8000001c: 0x20800, + 0x8000001d: 0x820, + 0x8000001e: 0x20020, + 0x8000001f: 0x8020800 + } + ]; + + // Masks that select the SBOX input + var SBOX_MASK = [ + 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, + 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f + ]; + + /** + * DES block cipher algorithm. + */ + var DES = C_algo.DES = BlockCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + + // Select 56 bits according to PC1 + var keyBits = []; + for (var i = 0; i < 56; i++) { + var keyBitPos = PC1[i] - 1; + keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1; + } + + // Assemble 16 subkeys + var subKeys = this._subKeys = []; + for (var nSubKey = 0; nSubKey < 16; nSubKey++) { + // Create subkey + var subKey = subKeys[nSubKey] = []; + + // Shortcut + var bitShift = BIT_SHIFTS[nSubKey]; + + // Select 48 bits according to PC2 + for (var i = 0; i < 24; i++) { + // Select from the left 28 key bits + subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6); + + // Select from the right 28 key bits + subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6); + } + + // Since each subkey is applied to an expanded 32-bit input, + // the subkey can be broken into 8 values scaled to 32-bits, + // which allows the key to be used without expansion + subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31); + for (var i = 1; i < 7; i++) { + subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3); + } + subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27); + } + + // Compute inverse subkeys + var invSubKeys = this._invSubKeys = []; + for (var i = 0; i < 16; i++) { + invSubKeys[i] = subKeys[15 - i]; + } + }, + + encryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._subKeys); + }, + + decryptBlock: function (M, offset) { + this._doCryptBlock(M, offset, this._invSubKeys); + }, + + _doCryptBlock: function (M, offset, subKeys) { + // Get input + this._lBlock = M[offset]; + this._rBlock = M[offset + 1]; + + // Initial permutation + exchangeLR.call(this, 4, 0x0f0f0f0f); + exchangeLR.call(this, 16, 0x0000ffff); + exchangeRL.call(this, 2, 0x33333333); + exchangeRL.call(this, 8, 0x00ff00ff); + exchangeLR.call(this, 1, 0x55555555); + + // Rounds + for (var round = 0; round < 16; round++) { + // Shortcuts + var subKey = subKeys[round]; + var lBlock = this._lBlock; + var rBlock = this._rBlock; + + // Feistel function + var f = 0; + for (var i = 0; i < 8; i++) { + f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; + } + this._lBlock = rBlock; + this._rBlock = lBlock ^ f; + } + + // Undo swap from last round + var t = this._lBlock; + this._lBlock = this._rBlock; + this._rBlock = t; + + // Final permutation + exchangeLR.call(this, 1, 0x55555555); + exchangeRL.call(this, 8, 0x00ff00ff); + exchangeRL.call(this, 2, 0x33333333); + exchangeLR.call(this, 16, 0x0000ffff); + exchangeLR.call(this, 4, 0x0f0f0f0f); + + // Set output + M[offset] = this._lBlock; + M[offset + 1] = this._rBlock; + }, + + keySize: 64/32, + + ivSize: 64/32, + + blockSize: 64/32 + }); + + // Swap bits across the left and right words + function exchangeLR(offset, mask) { + var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask; + this._rBlock ^= t; + this._lBlock ^= t << offset; + } + + function exchangeRL(offset, mask) { + var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask; + this._lBlock ^= t; + this._rBlock ^= t << offset; + } + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg); + */ + C.DES = BlockCipher._createHelper(DES); + + /** + * Triple-DES block cipher algorithm. + */ + var TripleDES = C_algo.TripleDES = BlockCipher.extend({ + _doReset: function () { + // Shortcuts + var key = this._key; + var keyWords = key.words; + + // Create DES instances + this._des1 = DES.createEncryptor(WordArray.create(keyWords.slice(0, 2))); + this._des2 = DES.createEncryptor(WordArray.create(keyWords.slice(2, 4))); + this._des3 = DES.createEncryptor(WordArray.create(keyWords.slice(4, 6))); + }, + + encryptBlock: function (M, offset) { + this._des1.encryptBlock(M, offset); + this._des2.decryptBlock(M, offset); + this._des3.encryptBlock(M, offset); + }, + + decryptBlock: function (M, offset) { + this._des3.decryptBlock(M, offset); + this._des2.encryptBlock(M, offset); + this._des1.decryptBlock(M, offset); + }, + + keySize: 192/32, + + ivSize: 64/32, + + blockSize: 64/32 + }); + + /** + * Shortcut functions to the cipher's object interface. + * + * @example + * + * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg); + * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg); + */ + C.TripleDES = BlockCipher._createHelper(TripleDES); +}()); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/x64-core-min.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/x64-core-min.js new file mode 100644 index 000000000..38f190571 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/components/x64-core-min.js @@ -0,0 +1,7 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +(function(g){var a=CryptoJS,f=a.lib,e=f.Base,h=f.WordArray,a=a.x64={};a.Word=e.extend({init:function(b,c){this.high=b;this.low=c}});a.WordArray=e.extend({init:function(b,c){b=this.words=b||[];this.sigBytes=c!=g?c:8*b.length},toX32:function(){for(var b=this.words,c=b.length,a=[],d=0;d>> (32 - n)); + // var low = this.low << n; + // } else { + // var high = this.low << (n - 32); + // var low = 0; + // } + + // return X64Word.create(high, low); + // }, + + /** + * Shifts this word n bits to the right. + * + * @param {number} n The number of bits to shift. + * + * @return {X64Word} A new x64-Word object after shifting. + * + * @example + * + * var shifted = x64Word.shiftR(7); + */ + // shiftR: function (n) { + // if (n < 32) { + // var low = (this.low >>> n) | (this.high << (32 - n)); + // var high = this.high >>> n; + // } else { + // var low = this.high >>> (n - 32); + // var high = 0; + // } + + // return X64Word.create(high, low); + // }, + + /** + * Rotates this word n bits to the left. + * + * @param {number} n The number of bits to rotate. + * + * @return {X64Word} A new x64-Word object after rotating. + * + * @example + * + * var rotated = x64Word.rotL(25); + */ + // rotL: function (n) { + // return this.shiftL(n).or(this.shiftR(64 - n)); + // }, + + /** + * Rotates this word n bits to the right. + * + * @param {number} n The number of bits to rotate. + * + * @return {X64Word} A new x64-Word object after rotating. + * + * @example + * + * var rotated = x64Word.rotR(7); + */ + // rotR: function (n) { + // return this.shiftR(n).or(this.shiftL(64 - n)); + // }, + + /** + * Adds this word with the passed word. + * + * @param {X64Word} word The x64-Word to add with this word. + * + * @return {X64Word} A new x64-Word object after adding. + * + * @example + * + * var added = x64Word.add(anotherX64Word); + */ + // add: function (word) { + // var low = (this.low + word.low) | 0; + // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0; + // var high = (this.high + word.high + carry) | 0; + + // return X64Word.create(high, low); + // } + }); + + /** + * An array of 64-bit words. + * + * @property {Array} words The array of CryptoJS.x64.Word objects. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var X64WordArray = C_x64.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.x64.WordArray.create(); + * + * var wordArray = CryptoJS.x64.WordArray.create([ + * CryptoJS.x64.Word.create(0x00010203, 0x04050607), + * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) + * ]); + * + * var wordArray = CryptoJS.x64.WordArray.create([ + * CryptoJS.x64.Word.create(0x00010203, 0x04050607), + * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f) + * ], 10); + */ + init: function (words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 8; + } + }, + + /** + * Converts this 64-bit word array to a 32-bit word array. + * + * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array. + * + * @example + * + * var x32WordArray = x64WordArray.toX32(); + */ + toX32: function () { + // Shortcuts + var x64Words = this.words; + var x64WordsLength = x64Words.length; + + // Convert + var x32Words = []; + for (var i = 0; i < x64WordsLength; i++) { + var x64Word = x64Words[i]; + x32Words.push(x64Word.high); + x32Words.push(x64Word.low); + } + + return X32WordArray.create(x32Words, this.sigBytes); + }, + + /** + * Creates a copy of this word array. + * + * @return {X64WordArray} The clone. + * + * @example + * + * var clone = x64WordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + + // Clone "words" array + var words = clone.words = this.words.slice(0); + + // Clone each X64Word object + var wordsLength = words.length; + for (var i = 0; i < wordsLength; i++) { + words[i] = words[i].clone(); + } + + return clone; + } + }); +}()); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/aes.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/aes.js new file mode 100644 index 000000000..a779f28d8 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/aes.js @@ -0,0 +1,32 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +var CryptoJS=CryptoJS||function(q,i){var f={},l=f.lib={},r=l.Base=function(){function a(){}return{extend:function(d){a.prototype=this;var b=new a;d&&b.mixIn(d);b.$super=this;return b},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),n=l.WordArray=r.extend({init:function(a,d){a= +this.words=a||[];this.sigBytes=d!=i?d:4*a.length},toString:function(a){return(a||s).stringify(this)},concat:function(a){var d=this.words,b=a.words,c=this.sigBytes,a=a.sigBytes;this.clamp();if(c%4)for(var g=0;g>>2]|=(b[g>>>2]>>>24-8*(g%4)&255)<<24-8*((c+g)%4);else if(65535>>2]=b[g>>>2];else d.push.apply(d,b);this.sigBytes+=a;return this},clamp:function(){var a=this.words,d=this.sigBytes;a[d>>>2]&=4294967295<<32-8*(d%4);a.length=q.ceil(d/4)},clone:function(){var a= +r.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var d=[],b=0;b>>2]>>>24-8*(c%4)&255;b.push((g>>>4).toString(16));b.push((g&15).toString(16))}return b.join("")},parse:function(a){for(var d=a.length,b=[],c=0;c>>3]|=parseInt(a.substr(c,2),16)<<24-4*(c%8);return n.create(b,d/2)}},o=m.Latin1={stringify:function(a){for(var d= +a.words,a=a.sigBytes,b=[],c=0;c>>2]>>>24-8*(c%4)&255));return b.join("")},parse:function(a){for(var d=a.length,b=[],c=0;c>>2]|=(a.charCodeAt(c)&255)<<24-8*(c%4);return n.create(b,d)}},p=m.Utf8={stringify:function(a){try{return decodeURIComponent(escape(o.stringify(a)))}catch(d){throw Error("Malformed UTF-8 data");}},parse:function(a){return o.parse(unescape(encodeURIComponent(a)))}},e=l.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=n.create(); +this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=p.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var d=this._data,b=d.words,c=d.sigBytes,g=this.blockSize,k=c/(4*g),k=a?q.ceil(k):q.max((k|0)-this._minBufferSize,0),a=k*g,c=q.min(4*a,c);if(a){for(var j=0;j>>2]>>>24-8*(m%4)&255)<<16|(l[m+1>>>2]>>>24-8*((m+1)%4)&255)<<8|l[m+2>>>2]>>>24-8*((m+2)%4)&255,o=0;4>o&&m+0.75*o>>6*(3-o)&63));if(l=n.charAt(64))for(;f.length%4;)f.push(l);return f.join("")},parse:function(f){var l=f.length,r=this._map,n=r.charAt(64);n&&(n=f.indexOf(n),-1!=n&&(l=n));for(var n=[],m=0,s=0;s< +l;s++)if(s%4){var o=r.indexOf(f.charAt(s-1))<<2*(s%4),p=r.indexOf(f.charAt(s))>>>6-2*(s%4);n[m>>>2]|=(o|p)<<24-8*(m%4);m++}return i.create(n,m)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})(); +(function(q){function i(e,h,a,d,b,c,g){e=e+(h&a|~h&d)+b+g;return(e<>>32-c)+h}function f(e,h,a,d,b,c,g){e=e+(h&d|a&~d)+b+g;return(e<>>32-c)+h}function l(e,h,a,d,b,c,g){e=e+(h^a^d)+b+g;return(e<>>32-c)+h}function r(e,h,a,d,b,c,g){e=e+(a^(h|~d))+b+g;return(e<>>32-c)+h}var n=CryptoJS,m=n.lib,s=m.WordArray,m=m.Hasher,o=n.algo,p=[];(function(){for(var e=0;64>e;e++)p[e]=4294967296*q.abs(q.sin(e+1))|0})();o=o.MD5=m.extend({_doReset:function(){this._hash=s.create([1732584193,4023233417, +2562383102,271733878])},_doProcessBlock:function(e,h){for(var a=0;16>a;a++){var d=h+a,b=e[d];e[d]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360}for(var d=this._hash.words,b=d[0],c=d[1],g=d[2],k=d[3],a=0;64>a;a+=4)16>a?(b=i(b,c,g,k,e[h+a],7,p[a]),k=i(k,b,c,g,e[h+a+1],12,p[a+1]),g=i(g,k,b,c,e[h+a+2],17,p[a+2]),c=i(c,g,k,b,e[h+a+3],22,p[a+3])):32>a?(b=f(b,c,g,k,e[h+(a+1)%16],5,p[a]),k=f(k,b,c,g,e[h+(a+6)%16],9,p[a+1]),g=f(g,k,b,c,e[h+(a+11)%16],14,p[a+2]),c=f(c,g,k,b,e[h+a%16],20,p[a+3])):48>a?(b= +l(b,c,g,k,e[h+(3*a+5)%16],4,p[a]),k=l(k,b,c,g,e[h+(3*a+8)%16],11,p[a+1]),g=l(g,k,b,c,e[h+(3*a+11)%16],16,p[a+2]),c=l(c,g,k,b,e[h+(3*a+14)%16],23,p[a+3])):(b=r(b,c,g,k,e[h+3*a%16],6,p[a]),k=r(k,b,c,g,e[h+(3*a+7)%16],10,p[a+1]),g=r(g,k,b,c,e[h+(3*a+14)%16],15,p[a+2]),c=r(c,g,k,b,e[h+(3*a+5)%16],21,p[a+3]));d[0]=d[0]+b|0;d[1]=d[1]+c|0;d[2]=d[2]+g|0;d[3]=d[3]+k|0},_doFinalize:function(){var e=this._data,h=e.words,a=8*this._nDataBytes,d=8*e.sigBytes;h[d>>>5]|=128<<24-d%32;h[(d+64>>>9<<4)+14]=(a<<8|a>>> +24)&16711935|(a<<24|a>>>8)&4278255360;e.sigBytes=4*(h.length+1);this._process();e=this._hash.words;for(h=0;4>h;h++)a=e[h],e[h]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}});n.MD5=m._createHelper(o);n.HmacMD5=m._createHmacHelper(o)})(Math); +(function(){var q=CryptoJS,i=q.lib,f=i.Base,l=i.WordArray,i=q.algo,r=i.EvpKDF=f.extend({cfg:f.extend({keySize:4,hasher:i.MD5,iterations:1}),init:function(f){this.cfg=this.cfg.extend(f)},compute:function(f,m){for(var i=this.cfg,o=i.hasher.create(),p=l.create(),e=p.words,h=i.keySize,i=i.iterations;e.length>>2]&255}};f.BlockCipher=o.extend({cfg:o.cfg.extend({mode:p,padding:h}),reset:function(){o.reset.call(this);var c=this.cfg,a=c.iv,c=c.mode;if(this._xformMode==this._ENC_XFORM_MODE)var b=c.createEncryptor;else b=c.createDecryptor, +this._minBufferSize=1;this._mode=b.call(c,this,a&&a.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var a=f.CipherParams=l.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),p=(i.format={}).OpenSSL={stringify:function(a){var b= +a.ciphertext,a=a.salt;return(a?r.create([1398893684,1701076831]).concat(a).concat(b):b).toString(m)},parse:function(c){var c=m.parse(c),b=c.words;if(1398893684==b[0]&&1701076831==b[1]){var d=r.create(b.slice(2,4));b.splice(0,4);c.sigBytes-=16}return a.create({ciphertext:c,salt:d})}},d=f.SerializableCipher=l.extend({cfg:l.extend({format:p}),encrypt:function(c,b,d,j){var j=this.cfg.extend(j),e=c.createEncryptor(d,j),b=e.finalize(b),e=e.cfg;return a.create({ciphertext:b,key:d,iv:e.iv,algorithm:c,mode:e.mode, +padding:e.padding,blockSize:c.blockSize,formatter:j.format})},decrypt:function(a,b,d,e){e=this.cfg.extend(e);b=this._parse(b,e.format);return a.createDecryptor(d,e).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),i=(i.kdf={}).OpenSSL={execute:function(c,b,d,e){e||(e=r.random(8));c=s.create({keySize:b+d}).compute(c,e);d=r.create(c.words.slice(b),4*d);c.sigBytes=4*b;return a.create({key:c,iv:d,salt:e})}},b=f.PasswordBasedCipher=d.extend({cfg:d.cfg.extend({kdf:i}), +encrypt:function(a,b,e,j){j=this.cfg.extend(j);e=j.kdf.execute(e,a.keySize,a.ivSize);j.iv=e.iv;a=d.encrypt.call(this,a,b,e.key,j);a.mixIn(e);return a},decrypt:function(a,b,e,j){j=this.cfg.extend(j);b=this._parse(b,j.format);e=j.kdf.execute(e,a.keySize,a.ivSize,b.salt);j.iv=e.iv;return d.decrypt.call(this,a,b,e.key,j)}})}(); +(function(){var q=CryptoJS,i=q.lib.BlockCipher,f=q.algo,l=[],r=[],n=[],m=[],s=[],o=[],p=[],e=[],h=[],a=[];(function(){for(var b=[],c=0;256>c;c++)b[c]=128>c?c<<1:c<<1^283;for(var d=0,k=0,c=0;256>c;c++){var j=k^k<<1^k<<2^k<<3^k<<4,j=j>>>8^j&255^99;l[d]=j;r[j]=d;var f=b[d],i=b[f],q=b[i],t=257*b[j]^16843008*j;n[d]=t<<24|t>>>8;m[d]=t<<16|t>>>16;s[d]=t<<8|t>>>24;o[d]=t;t=16843009*q^65537*i^257*f^16843008*d;p[j]=t<<24|t>>>8;e[j]=t<<16|t>>>16;h[j]=t<<8|t>>>24;a[j]=t;d?(d=f^b[b[b[q^f]]],k^=b[b[k]]):d=k=1}})(); +var d=[0,1,2,4,8,16,32,64,128,27,54],f=f.AES=i.extend({_doReset:function(){for(var b=this._key,c=b.words,g=b.sigBytes/4,b=4*((this._nRounds=g+6)+1),k=this._keySchedule=[],j=0;j>>24]<<24|l[f>>>16&255]<<16|l[f>>>8&255]<<8|l[f&255]):(f=f<<8|f>>>24,f=l[f>>>24]<<24|l[f>>>16&255]<<16|l[f>>>8&255]<<8|l[f&255],f^=d[j/g|0]<<24);k[j]=k[j-g]^f}c=this._invKeySchedule=[];for(g=0;gg||4>=j?f:p[l[f>>>24]]^e[l[f>>> +16&255]]^h[l[f>>>8&255]]^a[l[f&255]]},encryptBlock:function(a,c){this._doCryptBlock(a,c,this._keySchedule,n,m,s,o,l)},decryptBlock:function(b,c){var d=b[c+1];b[c+1]=b[c+3];b[c+3]=d;this._doCryptBlock(b,c,this._invKeySchedule,p,e,h,a,r);d=b[c+1];b[c+1]=b[c+3];b[c+3]=d},_doCryptBlock:function(a,c,d,e,f,h,l,i){for(var p=this._nRounds,m=a[c]^d[0],n=a[c+1]^d[1],o=a[c+2]^d[2],q=a[c+3]^d[3],r=4,s=1;s>>24]^f[n>>>16&255]^h[o>>>8&255]^l[q&255]^d[r++],v=e[n>>>24]^f[o>>>16&255]^h[q>>>8&255]^ +l[m&255]^d[r++],w=e[o>>>24]^f[q>>>16&255]^h[m>>>8&255]^l[n&255]^d[r++],q=e[q>>>24]^f[m>>>16&255]^h[n>>>8&255]^l[o&255]^d[r++],m=u,n=v,o=w;u=(i[m>>>24]<<24|i[n>>>16&255]<<16|i[o>>>8&255]<<8|i[q&255])^d[r++];v=(i[n>>>24]<<24|i[o>>>16&255]<<16|i[q>>>8&255]<<8|i[m&255])^d[r++];w=(i[o>>>24]<<24|i[q>>>16&255]<<16|i[m>>>8&255]<<8|i[n&255])^d[r++];q=(i[q>>>24]<<24|i[m>>>16&255]<<16|i[n>>>8&255]<<8|i[o&255])^d[r++];a[c]=u;a[c+1]=v;a[c+2]=w;a[c+3]=q},keySize:8});q.AES=i._createHelper(f)})(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/hmac-md5.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/hmac-md5.js new file mode 100644 index 000000000..23f0f795d --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/hmac-md5.js @@ -0,0 +1,18 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +var CryptoJS=CryptoJS||function(l,q){var g={},i=g.lib={},p=i.Base=function(){function a(){}return{extend:function(f){a.prototype=this;var c=new a;f&&c.mixIn(f);c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),m=i.WordArray=p.extend({init:function(a,f){a= +this.words=a||[];this.sigBytes=f!=q?f:4*a.length},toString:function(a){return(a||r).stringify(this)},concat:function(a){var f=this.words,c=a.words,d=this.sigBytes,a=a.sigBytes;this.clamp();if(d%4)for(var b=0;b>>2]|=(c[b>>>2]>>>24-8*(b%4)&255)<<24-8*((d+b)%4);else if(65535>>2]=c[b>>>2];else f.push.apply(f,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-8*(b%4);a.length=l.ceil(b/4)},clone:function(){var a= +p.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],c=0;c>>2]>>>24-8*(d%4)&255;c.push((e>>>4).toString(16));c.push((e&15).toString(16))}return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>3]|=parseInt(a.substr(d,2),16)<<24-4*(d%8);return m.create(c,b/2)}},o=n.Latin1={stringify:function(a){for(var b= +a.words,a=a.sigBytes,c=[],d=0;d>>2]>>>24-8*(d%4)&255));return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return m.create(c,b)}},j=n.Utf8={stringify:function(a){try{return decodeURIComponent(escape(o.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return o.parse(unescape(encodeURIComponent(a)))}},b=i.BufferedBlockAlgorithm=p.extend({reset:function(){this._data=m.create(); +this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=j.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,c=b.words,d=b.sigBytes,e=this.blockSize,h=d/(4*e),h=a?l.ceil(h):l.max((h|0)-this._minBufferSize,0),a=h*e,d=l.min(4*a,d);if(a){for(var g=0;g>>32-d)+e}function g(b,e,a,f,c,d,g){b=b+(e&f|a&~f)+c+g;return(b<>>32-d)+e}function i(b,e,a,f,c,d,g){b=b+(e^a^f)+c+g;return(b<>>32-d)+e}function p(b,e,a,f,c,d,g){b=b+(a^(e|~f))+c+g;return(b<>>32-d)+e}var m=CryptoJS,n=m.lib,r=n.WordArray,n=n.Hasher,o=m.algo,j=[];(function(){for(var b=0;64>b;b++)j[b]=4294967296*l.abs(l.sin(b+1))|0})();o=o.MD5=n.extend({_doReset:function(){this._hash=r.create([1732584193,4023233417, +2562383102,271733878])},_doProcessBlock:function(b,e){for(var a=0;16>a;a++){var f=e+a,c=b[f];b[f]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360}for(var f=this._hash.words,c=f[0],d=f[1],k=f[2],h=f[3],a=0;64>a;a+=4)16>a?(c=q(c,d,k,h,b[e+a],7,j[a]),h=q(h,c,d,k,b[e+a+1],12,j[a+1]),k=q(k,h,c,d,b[e+a+2],17,j[a+2]),d=q(d,k,h,c,b[e+a+3],22,j[a+3])):32>a?(c=g(c,d,k,h,b[e+(a+1)%16],5,j[a]),h=g(h,c,d,k,b[e+(a+6)%16],9,j[a+1]),k=g(k,h,c,d,b[e+(a+11)%16],14,j[a+2]),d=g(d,k,h,c,b[e+a%16],20,j[a+3])):48>a?(c= +i(c,d,k,h,b[e+(3*a+5)%16],4,j[a]),h=i(h,c,d,k,b[e+(3*a+8)%16],11,j[a+1]),k=i(k,h,c,d,b[e+(3*a+11)%16],16,j[a+2]),d=i(d,k,h,c,b[e+(3*a+14)%16],23,j[a+3])):(c=p(c,d,k,h,b[e+3*a%16],6,j[a]),h=p(h,c,d,k,b[e+(3*a+7)%16],10,j[a+1]),k=p(k,h,c,d,b[e+(3*a+14)%16],15,j[a+2]),d=p(d,k,h,c,b[e+(3*a+5)%16],21,j[a+3]));f[0]=f[0]+c|0;f[1]=f[1]+d|0;f[2]=f[2]+k|0;f[3]=f[3]+h|0},_doFinalize:function(){var b=this._data,e=b.words,a=8*this._nDataBytes,f=8*b.sigBytes;e[f>>>5]|=128<<24-f%32;e[(f+64>>>9<<4)+14]=(a<<8|a>>> +24)&16711935|(a<<24|a>>>8)&4278255360;b.sigBytes=4*(e.length+1);this._process();b=this._hash.words;for(e=0;4>e;e++)a=b[e],b[e]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}});m.MD5=n._createHelper(o);m.HmacMD5=n._createHmacHelper(o)})(Math); +(function(){var l=CryptoJS,q=l.enc.Utf8;l.algo.HMAC=l.lib.Base.extend({init:function(g,i){g=this._hasher=g.create();"string"==typeof i&&(i=q.parse(i));var l=g.blockSize,m=4*l;i.sigBytes>m&&(i=g.finalize(i));for(var n=this._oKey=i.clone(),r=this._iKey=i.clone(),o=n.words,j=r.words,b=0;b>>2]|=(c[b>>>2]>>>24-8*(b%4)&255)<<24-8*((o+b)%4);else if(65535>>2]=c[b>>>2];else e.push.apply(e,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,e=this.sigBytes;a[e>>>2]&=4294967295<<32-8*(e%4);a.length=i.ceil(e/4)},clone:function(){var a= +m.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var e=[],c=0;c>>2]>>>24-8*(b%4)&255;c.push((d>>>4).toString(16));c.push((d&15).toString(16))}return c.join("")},parse:function(a){for(var e=a.length,c=[],b=0;b>>3]|=parseInt(a.substr(b,2),16)<<24-4*(b%8);return l.create(c,e/2)}},h=n.Latin1={stringify:function(a){for(var e= +a.words,a=a.sigBytes,b=[],d=0;d>>2]>>>24-8*(d%4)&255));return b.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return l.create(c,b)}},k=n.Utf8={stringify:function(a){try{return decodeURIComponent(escape(h.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return h.parse(unescape(encodeURIComponent(a)))}},g=b.BufferedBlockAlgorithm=m.extend({reset:function(){this._data=l.create(); +this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=k.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,c=b.words,d=b.sigBytes,f=this.blockSize,g=d/(4*f),g=a?i.ceil(g):i.max((g|0)-this._minBufferSize,0),a=g*f,d=i.min(4*a,d);if(a){for(var h=0;he;e++){if(16>e)b[e]=f[i+e]|0;else{var c=b[e-3]^b[e-8]^b[e-14]^b[e-16];b[e]=c<<1|c>>>31}c=(h<<5|h>>>27)+a+b[e];c=20>e?c+((k&g|~k&j)+1518500249):40>e?c+((k^g^j)+1859775393):60>e?c+((k&g|k&j|g&j)-1894007588):c+((k^g^j)- +899497514);a=j;j=g;g=k<<30|k>>>2;k=h;h=c}d[0]=d[0]+h|0;d[1]=d[1]+k|0;d[2]=d[2]+g|0;d[3]=d[3]+j|0;d[4]=d[4]+a|0},_doFinalize:function(){var b=this._data,f=b.words,d=8*this._nDataBytes,h=8*b.sigBytes;f[h>>>5]|=128<<24-h%32;f[(h+64>>>9<<4)+15]=d;b.sigBytes=4*f.length;this._process()}});i.SHA1=j._createHelper(m);i.HmacSHA1=j._createHmacHelper(m)})(); +(function(){var i=CryptoJS,j=i.enc.Utf8;i.algo.HMAC=i.lib.Base.extend({init:function(f,b){f=this._hasher=f.create();"string"==typeof b&&(b=j.parse(b));var i=f.blockSize,l=4*i;b.sigBytes>l&&(b=f.finalize(b));for(var n=this._oKey=b.clone(),d=this._iKey=b.clone(),h=n.words,k=d.words,g=0;g>>2]|=(e[b>>>2]>>>24-8*(b%4)&255)<<24-8*((c+b)%4);else if(65535>>2]=e[b>>>2];else n.push.apply(n,e);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-8*(b%4);a.length=h.ceil(b/4)},clone:function(){var a= +k.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],e=0;e>>2]>>>24-8*(c%4)&255;e.push((d>>>4).toString(16));e.push((d&15).toString(16))}return e.join("")},parse:function(a){for(var b=a.length,e=[],c=0;c>>3]|=parseInt(a.substr(c,2),16)<<24-4*(c%8);return i.create(e,b/2)}},r=o.Latin1={stringify:function(a){for(var b= +a.words,a=a.sigBytes,e=[],c=0;c>>2]>>>24-8*(c%4)&255));return e.join("")},parse:function(a){for(var b=a.length,e=[],c=0;c>>2]|=(a.charCodeAt(c)&255)<<24-8*(c%4);return i.create(e,b)}},s=o.Utf8={stringify:function(a){try{return decodeURIComponent(escape(r.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return r.parse(unescape(encodeURIComponent(a)))}},b=f.BufferedBlockAlgorithm=k.extend({reset:function(){this._data=i.create(); +this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=s.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,e=b.words,c=b.sigBytes,d=this.blockSize,f=c/(4*d),f=a?h.ceil(f):h.max((f|0)-this._minBufferSize,0),a=f*d,c=h.min(4*a,c);if(a){for(var g=0;gg;)d(b)&&(8>g&&(i[g]=f(h.pow(b,0.5))),o[g]=f(h.pow(b,1/3)),g++),b++})();var l=[],k=k.SHA256=d.extend({_doReset:function(){this._hash=f.create(i.slice(0))},_doProcessBlock:function(d,f){for(var b=this._hash.words,g=b[0],a=b[1],h=b[2],e=b[3],c=b[4],k=b[5],i=b[6],j=b[7],m=0;64> +m;m++){if(16>m)l[m]=d[f+m]|0;else{var p=l[m-15],q=l[m-2];l[m]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+l[m-7]+((q<<15|q>>>17)^(q<<13|q>>>19)^q>>>10)+l[m-16]}p=j+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&k^~c&i)+o[m]+l[m];q=((g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22))+(g&a^g&h^a&h);j=i;i=k;k=c;c=e+p|0;e=h;h=a;a=g;g=p+q|0}b[0]=b[0]+g|0;b[1]=b[1]+a|0;b[2]=b[2]+h|0;b[3]=b[3]+e|0;b[4]=b[4]+c|0;b[5]=b[5]+k|0;b[6]=b[6]+i|0;b[7]=b[7]+j|0},_doFinalize:function(){var d=this._data,f=d.words,b=8*this._nDataBytes, +g=8*d.sigBytes;f[g>>>5]|=128<<24-g%32;f[(g+64>>>9<<4)+15]=b;d.sigBytes=4*f.length;this._process()}});j.SHA256=d._createHelper(k);j.HmacSHA256=d._createHmacHelper(k)})(Math); +(function(){var h=CryptoJS,j=h.lib.WordArray,d=h.algo,f=d.SHA256,d=d.SHA224=f.extend({_doReset:function(){this._hash=j.create([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){f._doFinalize.call(this);this._hash.sigBytes-=4}});h.SHA224=f._createHelper(d);h.HmacSHA224=f._createHmacHelper(d)})(); +(function(){var h=CryptoJS,j=h.enc.Utf8;h.algo.HMAC=h.lib.Base.extend({init:function(d,f){d=this._hasher=d.create();"string"==typeof f&&(f=j.parse(f));var h=d.blockSize,i=4*h;f.sigBytes>i&&(f=d.finalize(f));for(var o=this._oKey=f.clone(),l=this._iKey=f.clone(),r=o.words,s=l.words,b=0;b>>2]|=(d[b>>>2]>>>24-8*(b%4)&255)<<24-8*((c+b)%4);else if(65535>>2]=d[b>>>2];else j.push.apply(j,d);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-8*(b%4);a.length=h.ceil(b/4)},clone:function(){var a= +l.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],d=0;d>>2]>>>24-8*(c%4)&255;d.push((e>>>4).toString(16));d.push((e&15).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c>>3]|=parseInt(a.substr(c,2),16)<<24-4*(c%8);return k.create(d,b/2)}},q=o.Latin1={stringify:function(a){for(var b= +a.words,a=a.sigBytes,d=[],c=0;c>>2]>>>24-8*(c%4)&255));return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c>>2]|=(a.charCodeAt(c)&255)<<24-8*(c%4);return k.create(d,b)}},r=o.Utf8={stringify:function(a){try{return decodeURIComponent(escape(q.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return q.parse(unescape(encodeURIComponent(a)))}},b=f.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=k.create(); +this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=r.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,d=b.words,c=b.sigBytes,e=this.blockSize,g=c/(4*e),g=a?h.ceil(g):h.max((g|0)-this._minBufferSize,0),a=g*e,c=h.min(4*a,c);if(a){for(var f=0;fg;)e(b)&&(8>g&&(k[g]=f(h.pow(b,0.5))),o[g]=f(h.pow(b,1/3)),g++),b++})();var m=[],l=l.SHA256=e.extend({_doReset:function(){this._hash=f.create(k.slice(0))},_doProcessBlock:function(e,f){for(var b=this._hash.words,g=b[0],a=b[1],j=b[2],d=b[3],c=b[4],h=b[5],l=b[6],k=b[7],n=0;64> +n;n++){if(16>n)m[n]=e[f+n]|0;else{var i=m[n-15],p=m[n-2];m[n]=((i<<25|i>>>7)^(i<<14|i>>>18)^i>>>3)+m[n-7]+((p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10)+m[n-16]}i=k+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&h^~c&l)+o[n]+m[n];p=((g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22))+(g&a^g&j^a&j);k=l;l=h;h=c;c=d+i|0;d=j;j=a;a=g;g=i+p|0}b[0]=b[0]+g|0;b[1]=b[1]+a|0;b[2]=b[2]+j|0;b[3]=b[3]+d|0;b[4]=b[4]+c|0;b[5]=b[5]+h|0;b[6]=b[6]+l|0;b[7]=b[7]+k|0},_doFinalize:function(){var e=this._data,f=e.words,b=8*this._nDataBytes, +g=8*e.sigBytes;f[g>>>5]|=128<<24-g%32;f[(g+64>>>9<<4)+15]=b;e.sigBytes=4*f.length;this._process()}});i.SHA256=e._createHelper(l);i.HmacSHA256=e._createHmacHelper(l)})(Math); +(function(){var h=CryptoJS,i=h.enc.Utf8;h.algo.HMAC=h.lib.Base.extend({init:function(e,f){e=this._hasher=e.create();"string"==typeof f&&(f=i.parse(f));var h=e.blockSize,k=4*h;f.sigBytes>k&&(f=e.finalize(f));for(var o=this._oKey=f.clone(),m=this._iKey=f.clone(),q=o.words,r=m.words,b=0;b>>2]|=(f[b>>>2]>>>24-8*(b%4)&255)<<24-8*((e+b)%4);else if(65535>>2]=f[b>>>2];else j.push.apply(j,f);this.sigBytes+=a;return this},clamp:function(){var u=this.words,b=this.sigBytes;u[b>>>2]&=4294967295<<32-8*(b%4);u.length=a.ceil(b/4)},clone:function(){var a= +i.clone.call(this);a.words=this.words.slice(0);return a},random:function(u){for(var b=[],f=0;f>>2]>>>24-8*(e%4)&255;f.push((c>>>4).toString(16));f.push((c&15).toString(16))}return f.join("")},parse:function(a){for(var b=a.length,f=[],e=0;e>>3]|=parseInt(a.substr(e,2),16)<<24-4*(e%8);return k.create(f,b/2)}},l=x.Latin1={stringify:function(a){for(var b= +a.words,a=a.sigBytes,f=[],e=0;e>>2]>>>24-8*(e%4)&255));return f.join("")},parse:function(a){for(var b=a.length,f=[],e=0;e>>2]|=(a.charCodeAt(e)&255)<<24-8*(e%4);return k.create(f,b)}},A=x.Utf8={stringify:function(a){try{return decodeURIComponent(escape(l.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return l.parse(unescape(encodeURIComponent(a)))}},m=c.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=k.create(); +this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=A.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(b){var c=this._data,f=c.words,e=c.sigBytes,m=this.blockSize,l=e/(4*m),l=b?a.ceil(l):a.max((l|0)-this._minBufferSize,0),b=l*m,e=a.min(4*b,e);if(b){for(var d=0;db;b++)q[b]=a()})();c=c.SHA512=b.extend({_doReset:function(){this._hash=k.create([a(1779033703,4089235720),a(3144134277,2227873595),a(1013904242,4271175723),a(2773480762,1595750129),a(1359893119,2917565137),a(2600822924,725511199),a(528734635,4215389547),a(1541459225,327033209)])},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],i=c[1],j=c[2],f=c[3],e=c[4],k=c[5],K= +c[6],c=c[7],Y=d.high,L=d.low,Z=i.high,M=i.low,$=j.high,N=j.low,aa=f.high,O=f.low,ba=e.high,P=e.low,ca=k.high,Q=k.low,da=K.high,R=K.low,ea=c.high,S=c.low,r=Y,n=L,E=Z,C=M,F=$,D=N,V=aa,G=O,s=ba,o=P,T=ca,H=Q,U=da,I=R,W=ea,J=S,t=0;80>t;t++){var y=q[t];if(16>t)var p=y.high=a[b+2*t]|0,g=y.low=a[b+2*t+1]|0;else{var p=q[t-15],g=p.high,v=p.low,p=(g>>>1|v<<31)^(g>>>8|v<<24)^g>>>7,v=(v>>>1|g<<31)^(v>>>8|g<<24)^(v>>>7|g<<25),B=q[t-2],g=B.high,h=B.low,B=(g>>>19|h<<13)^(g<<3|h>>>29)^g>>>6,h=(h>>>19|g<<13)^(h<<3| +g>>>29)^(h>>>6|g<<26),g=q[t-7],X=g.high,z=q[t-16],w=z.high,z=z.low,g=v+g.low,p=p+X+(g>>>0>>0?1:0),g=g+h,p=p+B+(g>>>0>>0?1:0),g=g+z,p=p+w+(g>>>0>>0?1:0);y.high=p;y.low=g}var X=s&T^~s&U,z=o&H^~o&I,y=r&E^r&F^E&F,ha=n&C^n&D^C&D,v=(r>>>28|n<<4)^(r<<30|n>>>2)^(r<<25|n>>>7),B=(n>>>28|r<<4)^(n<<30|r>>>2)^(n<<25|r>>>7),h=x[t],ia=h.high,fa=h.low,h=J+((o>>>14|s<<18)^(o>>>18|s<<14)^(o<<23|s>>>9)),w=W+((s>>>14|o<<18)^(s>>>18|o<<14)^(s<<23|o>>>9))+(h>>>0>>0?1:0),h=h+z,w=w+X+(h>>>0>>0?1:0),h=h+fa, +w=w+ia+(h>>>0>>0?1:0),h=h+g,w=w+p+(h>>>0>>0?1:0),g=B+ha,y=v+y+(g>>>0>>0?1:0),W=U,J=I,U=T,I=H,T=s,H=o,o=G+h|0,s=V+w+(o>>>0>>0?1:0)|0,V=F,G=D,F=E,D=C,E=r,C=n,n=h+g|0,r=w+y+(n>>>0>>0?1:0)|0}L=d.low=L+n;d.high=Y+r+(L>>>0>>0?1:0);M=i.low=M+C;i.high=Z+E+(M>>>0>>0?1:0);N=j.low=N+D;j.high=$+F+(N>>>0>>0?1:0);O=f.low=O+G;f.high=aa+V+(O>>>0>>0?1:0);P=e.low=P+o;e.high=ba+s+(P>>>0>>0?1:0);Q=k.low=Q+H;k.high=ca+T+(Q>>>0>>0?1:0);R=K.low=R+I;K.high=da+U+(R>>>0>>0?1:0);S=c.low= +S+J;c.high=ea+W+(S>>>0>>0?1:0)},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;b[d>>>5]|=128<<24-d%32;b[(d+128>>>10<<5)+31]=c;a.sigBytes=4*b.length;this._process();this._hash=this._hash.toX32()},blockSize:32});d.SHA512=b._createHelper(c);d.HmacSHA512=b._createHmacHelper(c)})(); +(function(){var a=CryptoJS,d=a.x64,b=d.Word,c=d.WordArray,d=a.algo,i=d.SHA512,d=d.SHA384=i.extend({_doReset:function(){this._hash=c.create([b.create(3418070365,3238371032),b.create(1654270250,914150663),b.create(2438529370,812702999),b.create(355462360,4144912697),b.create(1731405415,4290775857),b.create(2394180231,1750603025),b.create(3675008525,1694076839),b.create(1203062813,3204075428)])},_doFinalize:function(){i._doFinalize.call(this);this._hash.sigBytes-=16}});a.SHA384=i._createHelper(d);a.HmacSHA384= +i._createHmacHelper(d)})(); +(function(){var a=CryptoJS,d=a.enc.Utf8;a.algo.HMAC=a.lib.Base.extend({init:function(a,c){a=this._hasher=a.create();"string"==typeof c&&(c=d.parse(c));var i=a.blockSize,k=4*i;c.sigBytes>k&&(c=a.finalize(c));for(var x=this._oKey=c.clone(),q=this._iKey=c.clone(),l=x.words,A=q.words,m=0;m>>2]|=(e[b>>>2]>>>24-8*(b%4)&255)<<24-8*((d+b)%4);else if(65535>>2]=e[b>>>2];else h.push.apply(h,e);this.sigBytes+=a;return this},clamp:function(){var m=this.words,h=this.sigBytes;m[h>>>2]&=4294967295<<32-8*(h%4);m.length=a.ceil(h/4)},clone:function(){var a= +k.clone.call(this);a.words=this.words.slice(0);return a},random:function(m){for(var h=[],b=0;b>>2]>>>24-8*(d%4)&255;e.push((l>>>4).toString(16));e.push((l&15).toString(16))}return e.join("")},parse:function(a){for(var b=a.length,e=[],d=0;d>>3]|=parseInt(a.substr(d,2),16)<<24-4*(d%8);return n.create(e,b/2)}},j=x.Latin1={stringify:function(a){for(var b= +a.words,a=a.sigBytes,e=[],d=0;d>>2]>>>24-8*(d%4)&255));return e.join("")},parse:function(a){for(var b=a.length,e=[],d=0;d>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return n.create(e,b)}},J=x.Utf8={stringify:function(a){try{return decodeURIComponent(escape(j.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return j.parse(unescape(encodeURIComponent(a)))}},l=b.BufferedBlockAlgorithm=k.extend({reset:function(){this._data=n.create(); +this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=J.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(b){var h=this._data,e=h.words,d=h.sigBytes,l=this.blockSize,c=d/(4*l),c=b?a.ceil(c):a.max((c|0)-this._minBufferSize,0),b=c*l,d=a.min(4*b,d);if(b){for(var j=0;jb;b++)r[b]=a()})();b=b.SHA512=c.extend({_doReset:function(){this._hash=n.create([a(1779033703,4089235720),a(3144134277,2227873595),a(1013904242,4271175723),a(2773480762,1595750129),a(1359893119,2917565137),a(2600822924,725511199),a(528734635,4215389547),a(1541459225,327033209)])},_doProcessBlock:function(a,b){for(var c=this._hash.words,g=c[0],m=c[1],h=c[2],e=c[3],d=c[4],k=c[5],n= +c[6],c=c[7],X=g.high,K=g.low,Y=m.high,L=m.low,Z=h.high,M=h.low,$=e.high,N=e.low,aa=d.high,O=d.low,ba=k.high,P=k.low,ca=n.high,Q=n.low,da=c.high,R=c.low,s=X,o=K,D=Y,B=L,E=Z,C=M,U=$,F=N,t=aa,p=O,S=ba,G=P,T=ca,H=Q,V=da,I=R,u=0;80>u;u++){var y=r[u];if(16>u)var q=y.high=a[b+2*u]|0,f=y.low=a[b+2*u+1]|0;else{var q=r[u-15],f=q.high,v=q.low,q=(f>>>1|v<<31)^(f>>>8|v<<24)^f>>>7,v=(v>>>1|f<<31)^(v>>>8|f<<24)^(v>>>7|f<<25),A=r[u-2],f=A.high,i=A.low,A=(f>>>19|i<<13)^(f<<3|i>>>29)^f>>>6,i=(i>>>19|f<<13)^(i<<3|f>>> +29)^(i>>>6|f<<26),f=r[u-7],W=f.high,z=r[u-16],w=z.high,z=z.low,f=v+f.low,q=q+W+(f>>>0>>0?1:0),f=f+i,q=q+A+(f>>>0>>0?1:0),f=f+z,q=q+w+(f>>>0>>0?1:0);y.high=q;y.low=f}var W=t&S^~t&T,z=p&G^~p&H,y=s&D^s&E^D&E,ga=o&B^o&C^B&C,v=(s>>>28|o<<4)^(s<<30|o>>>2)^(s<<25|o>>>7),A=(o>>>28|s<<4)^(o<<30|s>>>2)^(o<<25|s>>>7),i=x[u],ha=i.high,ea=i.low,i=I+((p>>>14|t<<18)^(p>>>18|t<<14)^(p<<23|t>>>9)),w=V+((t>>>14|p<<18)^(t>>>18|p<<14)^(t<<23|p>>>9))+(i>>>0>>0?1:0),i=i+z,w=w+W+(i>>>0>>0?1:0),i=i+ea,w=w+ +ha+(i>>>0>>0?1:0),i=i+f,w=w+q+(i>>>0>>0?1:0),f=A+ga,y=v+y+(f>>>0>>0?1:0),V=T,I=H,T=S,H=G,S=t,G=p,p=F+i|0,t=U+w+(p>>>0>>0?1:0)|0,U=E,F=C,E=D,C=B,D=s,B=o,o=i+f|0,s=w+y+(o>>>0>>0?1:0)|0}K=g.low=K+o;g.high=X+s+(K>>>0>>0?1:0);L=m.low=L+B;m.high=Y+D+(L>>>0>>0?1:0);M=h.low=M+C;h.high=Z+E+(M>>>0>>0?1:0);N=e.low=N+F;e.high=$+U+(N>>>0>>0?1:0);O=d.low=O+p;d.high=aa+t+(O>>>0

>>0?1:0);P=k.low=P+G;k.high=ba+S+(P>>>0>>0?1:0);Q=n.low=Q+H;n.high=ca+T+(Q>>>0>>0?1:0);R=c.low=R+I; +c.high=da+V+(R>>>0>>0?1:0)},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,g=8*a.sigBytes;b[g>>>5]|=128<<24-g%32;b[(g+128>>>10<<5)+31]=c;a.sigBytes=4*b.length;this._process();this._hash=this._hash.toX32()},blockSize:32});g.SHA512=c._createHelper(b);g.HmacSHA512=c._createHmacHelper(b)})(); +(function(){var a=CryptoJS,g=a.enc.Utf8;a.algo.HMAC=a.lib.Base.extend({init:function(a,b){a=this._hasher=a.create();"string"==typeof b&&(b=g.parse(b));var k=a.blockSize,n=4*k;b.sigBytes>n&&(b=a.finalize(b));for(var x=this._oKey=b.clone(),r=this._iKey=b.clone(),j=x.words,J=r.words,l=0;l>>2]|=(c[b>>>2]>>>24-8*(b%4)&255)<<24-8*((d+b)%4);else if(65535>>2]=c[b>>>2];else e.push.apply(e,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,e=this.sigBytes;a[e>>>2]&=4294967295<<32-8*(e%4);a.length=o.ceil(e/4)},clone:function(){var a= +n.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var e=[],c=0;c>>2]>>>24-8*(d%4)&255;c.push((b>>>4).toString(16));c.push((b&15).toString(16))}return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>3]|=parseInt(a.substr(d,2),16)<<24-4*(d%8);return j.create(c,b/2)}},p=k.Latin1={stringify:function(a){for(var b= +a.words,a=a.sigBytes,c=[],d=0;d>>2]>>>24-8*(d%4)&255));return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return j.create(c,b)}},h=k.Utf8={stringify:function(a){try{return decodeURIComponent(escape(p.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return p.parse(unescape(encodeURIComponent(a)))}},b=m.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=j.create(); +this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=h.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,c=b.words,d=b.sigBytes,f=this.blockSize,i=d/(4*f),i=a?o.ceil(i):o.max((i|0)-this._minBufferSize,0),a=i*f,d=o.min(4*a,d);if(a){for(var h=0;h>>32-d)+f}function l(b,f,a,e,c,d,g){b=b+(f&e|a&~e)+c+g;return(b<>>32-d)+f}function m(b,f,a,e,c,d,g){b=b+(f^a^e)+c+g;return(b<>>32-d)+f}function n(b,f,a,e,c,d,g){b=b+(a^(f|~e))+c+g;return(b<>>32-d)+f}var j=CryptoJS,k=j.lib,r=k.WordArray,k=k.Hasher,p=j.algo,h=[];(function(){for(var b=0;64>b;b++)h[b]=4294967296*o.abs(o.sin(b+1))|0})();p=p.MD5=k.extend({_doReset:function(){this._hash=r.create([1732584193,4023233417, +2562383102,271733878])},_doProcessBlock:function(b,f){for(var a=0;16>a;a++){var e=f+a,c=b[e];b[e]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360}for(var e=this._hash.words,c=e[0],d=e[1],g=e[2],i=e[3],a=0;64>a;a+=4)16>a?(c=q(c,d,g,i,b[f+a],7,h[a]),i=q(i,c,d,g,b[f+a+1],12,h[a+1]),g=q(g,i,c,d,b[f+a+2],17,h[a+2]),d=q(d,g,i,c,b[f+a+3],22,h[a+3])):32>a?(c=l(c,d,g,i,b[f+(a+1)%16],5,h[a]),i=l(i,c,d,g,b[f+(a+6)%16],9,h[a+1]),g=l(g,i,c,d,b[f+(a+11)%16],14,h[a+2]),d=l(d,g,i,c,b[f+a%16],20,h[a+3])):48>a?(c= +m(c,d,g,i,b[f+(3*a+5)%16],4,h[a]),i=m(i,c,d,g,b[f+(3*a+8)%16],11,h[a+1]),g=m(g,i,c,d,b[f+(3*a+11)%16],16,h[a+2]),d=m(d,g,i,c,b[f+(3*a+14)%16],23,h[a+3])):(c=n(c,d,g,i,b[f+3*a%16],6,h[a]),i=n(i,c,d,g,b[f+(3*a+7)%16],10,h[a+1]),g=n(g,i,c,d,b[f+(3*a+14)%16],15,h[a+2]),d=n(d,g,i,c,b[f+(3*a+5)%16],21,h[a+3]));e[0]=e[0]+c|0;e[1]=e[1]+d|0;e[2]=e[2]+g|0;e[3]=e[3]+i|0},_doFinalize:function(){var b=this._data,f=b.words,a=8*this._nDataBytes,e=8*b.sigBytes;f[e>>>5]|=128<<24-e%32;f[(e+64>>>9<<4)+14]=(a<<8|a>>> +24)&16711935|(a<<24|a>>>8)&4278255360;b.sigBytes=4*(f.length+1);this._process();b=this._hash.words;for(f=0;4>f;f++)a=b[f],b[f]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}});j.MD5=k._createHelper(p);j.HmacMD5=k._createHmacHelper(p)})(Math); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/pbkdf2.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/pbkdf2.js new file mode 100644 index 000000000..ec2c8b6bb --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/pbkdf2.js @@ -0,0 +1,18 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +var CryptoJS=CryptoJS||function(g,i){var f={},b=f.lib={},m=b.Base=function(){function a(){}return{extend:function(e){a.prototype=this;var c=new a;e&&c.mixIn(e);c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),l=b.WordArray=m.extend({init:function(a,e){a= +this.words=a||[];this.sigBytes=e!=i?e:4*a.length},toString:function(a){return(a||d).stringify(this)},concat:function(a){var e=this.words,c=a.words,o=this.sigBytes,a=a.sigBytes;this.clamp();if(o%4)for(var b=0;b>>2]|=(c[b>>>2]>>>24-8*(b%4)&255)<<24-8*((o+b)%4);else if(65535>>2]=c[b>>>2];else e.push.apply(e,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,e=this.sigBytes;a[e>>>2]&=4294967295<<32-8*(e%4);a.length=g.ceil(e/4)},clone:function(){var a= +m.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var e=[],c=0;c>>2]>>>24-8*(b%4)&255;c.push((d>>>4).toString(16));c.push((d&15).toString(16))}return c.join("")},parse:function(a){for(var e=a.length,c=[],b=0;b>>3]|=parseInt(a.substr(b,2),16)<<24-4*(b%8);return l.create(c,e/2)}},j=n.Latin1={stringify:function(a){for(var e= +a.words,a=a.sigBytes,b=[],d=0;d>>2]>>>24-8*(d%4)&255));return b.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return l.create(c,b)}},k=n.Utf8={stringify:function(a){try{return decodeURIComponent(escape(j.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return j.parse(unescape(encodeURIComponent(a)))}},h=b.BufferedBlockAlgorithm=m.extend({reset:function(){this._data=l.create(); +this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=k.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,c=b.words,d=b.sigBytes,j=this.blockSize,h=d/(4*j),h=a?g.ceil(h):g.max((h|0)-this._minBufferSize,0),a=h*j,d=g.min(4*a,d);if(a){for(var f=0;fe;e++){if(16>e)b[e]=f[n+e]|0;else{var c=b[e-3]^b[e-8]^b[e-14]^b[e-16];b[e]=c<<1|c>>>31}c=(j<<5|j>>>27)+a+b[e];c=20>e?c+((k&h|~k&g)+1518500249):40>e?c+((k^h^g)+1859775393):60>e?c+((k&h|k&g|h&g)-1894007588):c+((k^h^g)- +899497514);a=g;g=h;h=k<<30|k>>>2;k=j;j=c}d[0]=d[0]+j|0;d[1]=d[1]+k|0;d[2]=d[2]+h|0;d[3]=d[3]+g|0;d[4]=d[4]+a|0},_doFinalize:function(){var b=this._data,f=b.words,d=8*this._nDataBytes,j=8*b.sigBytes;f[j>>>5]|=128<<24-j%32;f[(j+64>>>9<<4)+15]=d;b.sigBytes=4*f.length;this._process()}});g.SHA1=i._createHelper(m);g.HmacSHA1=i._createHmacHelper(m)})(); +(function(){var g=CryptoJS,i=g.enc.Utf8;g.algo.HMAC=g.lib.Base.extend({init:function(f,b){f=this._hasher=f.create();"string"==typeof b&&(b=i.parse(b));var g=f.blockSize,l=4*g;b.sigBytes>l&&(b=f.finalize(b));for(var n=this._oKey=b.clone(),d=this._iKey=b.clone(),j=n.words,k=d.words,h=0;h>>2]|=(c[h>>>2]>>>24-8*(h%4)&255)<<24-8*((g+h)%4);else if(65535>>2]=c[h>>>2];else a.push.apply(a,c);this.sigBytes+=b;return this},clamp:function(){var b=this.words,a=this.sigBytes;b[a>>>2]&=4294967295<<32-8*(a%4);b.length=n.ceil(a/4)},clone:function(){var b= +k.clone.call(this);b.words=this.words.slice(0);return b},random:function(b){for(var a=[],c=0;c>>2]>>>24-8*(g%4)&255;c.push((h>>>4).toString(16));c.push((h&15).toString(16))}return c.join("")},parse:function(b){for(var a=b.length,c=[],g=0;g>>3]|=parseInt(b.substr(g,2),16)<<24-4*(g%8);return d.create(c,a/2)}},f=e.Latin1={stringify:function(b){for(var a= +b.words,b=b.sigBytes,c=[],g=0;g>>2]>>>24-8*(g%4)&255));return c.join("")},parse:function(b){for(var a=b.length,c=[],g=0;g>>2]|=(b.charCodeAt(g)&255)<<24-8*(g%4);return d.create(c,a)}},c=e.Utf8={stringify:function(b){try{return decodeURIComponent(escape(f.stringify(b)))}catch(a){throw Error("Malformed UTF-8 data");}},parse:function(b){return f.parse(unescape(encodeURIComponent(b)))}},o=j.BufferedBlockAlgorithm=k.extend({reset:function(){this._data=d.create(); +this._nDataBytes=0},_append:function(b){"string"==typeof b&&(b=c.parse(b));this._data.concat(b);this._nDataBytes+=b.sigBytes},_process:function(b){var a=this._data,c=a.words,g=a.sigBytes,h=this.blockSize,m=g/(4*h),m=b?n.ceil(m):n.max((m|0)-this._minBufferSize,0),b=m*h,g=n.min(4*b,g);if(b){for(var o=0;o>>2]>>>24-8*(e%4)&255)<<16|(j[e+1>>>2]>>>24-8*((e+1)%4)&255)<<8|j[e+2>>>2]>>>24-8*((e+2)%4)&255,f=0;4>f&&e+0.75*f>>6*(3-f)&63));if(j=d.charAt(64))for(;i.length%4;)i.push(j);return i.join("")},parse:function(i){var j=i.length,k=this._map,d=k.charAt(64);d&&(d=i.indexOf(d),-1!=d&&(j=d));for(var d=[],e=0,a=0;a< +j;a++)if(a%4){var f=k.indexOf(i.charAt(a-1))<<2*(a%4),c=k.indexOf(i.charAt(a))>>>6-2*(a%4);d[e>>>2]|=(f|c)<<24-8*(e%4);e++}return l.create(d,e)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})(); +(function(n){function l(a,c,b,d,f,g,h){a=a+(c&b|~c&d)+f+h;return(a<>>32-g)+c}function i(a,c,b,d,f,g,h){a=a+(c&d|b&~d)+f+h;return(a<>>32-g)+c}function j(a,c,b,d,f,g,h){a=a+(c^b^d)+f+h;return(a<>>32-g)+c}function k(a,c,b,d,f,g,h){a=a+(b^(c|~d))+f+h;return(a<>>32-g)+c}var d=CryptoJS,e=d.lib,a=e.WordArray,e=e.Hasher,f=d.algo,c=[];(function(){for(var a=0;64>a;a++)c[a]=4294967296*n.abs(n.sin(a+1))|0})();f=f.MD5=e.extend({_doReset:function(){this._hash=a.create([1732584193,4023233417, +2562383102,271733878])},_doProcessBlock:function(a,d){for(var b=0;16>b;b++){var f=d+b,e=a[f];a[f]=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360}for(var f=this._hash.words,e=f[0],g=f[1],h=f[2],m=f[3],b=0;64>b;b+=4)16>b?(e=l(e,g,h,m,a[d+b],7,c[b]),m=l(m,e,g,h,a[d+b+1],12,c[b+1]),h=l(h,m,e,g,a[d+b+2],17,c[b+2]),g=l(g,h,m,e,a[d+b+3],22,c[b+3])):32>b?(e=i(e,g,h,m,a[d+(b+1)%16],5,c[b]),m=i(m,e,g,h,a[d+(b+6)%16],9,c[b+1]),h=i(h,m,e,g,a[d+(b+11)%16],14,c[b+2]),g=i(g,h,m,e,a[d+b%16],20,c[b+3])):48>b?(e= +j(e,g,h,m,a[d+(3*b+5)%16],4,c[b]),m=j(m,e,g,h,a[d+(3*b+8)%16],11,c[b+1]),h=j(h,m,e,g,a[d+(3*b+11)%16],16,c[b+2]),g=j(g,h,m,e,a[d+(3*b+14)%16],23,c[b+3])):(e=k(e,g,h,m,a[d+3*b%16],6,c[b]),m=k(m,e,g,h,a[d+(3*b+7)%16],10,c[b+1]),h=k(h,m,e,g,a[d+(3*b+14)%16],15,c[b+2]),g=k(g,h,m,e,a[d+(3*b+5)%16],21,c[b+3]));f[0]=f[0]+e|0;f[1]=f[1]+g|0;f[2]=f[2]+h|0;f[3]=f[3]+m|0},_doFinalize:function(){var a=this._data,c=a.words,b=8*this._nDataBytes,d=8*a.sigBytes;c[d>>>5]|=128<<24-d%32;c[(d+64>>>9<<4)+14]=(b<<8|b>>> +24)&16711935|(b<<24|b>>>8)&4278255360;a.sigBytes=4*(c.length+1);this._process();a=this._hash.words;for(c=0;4>c;c++)b=a[c],a[c]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360}});d.MD5=e._createHelper(f);d.HmacMD5=e._createHmacHelper(f)})(Math); +(function(){var n=CryptoJS,l=n.lib,i=l.Base,j=l.WordArray,l=n.algo,k=l.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:l.MD5,iterations:1}),init:function(d){this.cfg=this.cfg.extend(d)},compute:function(d,e){for(var a=this.cfg,f=a.hasher.create(),c=j.create(),i=c.words,k=a.keySize,a=a.iterations;i.length>>2]&255}};i.BlockCipher=f.extend({cfg:f.cfg.extend({mode:c,padding:q}),reset:function(){f.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=a.createEncryptor;else c=a.createDecryptor, +this._minBufferSize=1;this._mode=c.call(a,this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var b=i.CipherParams=j.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),c=(l.format={}).OpenSSL={stringify:function(a){var b= +a.ciphertext,a=a.salt;return(a?k.create([1398893684,1701076831]).concat(a).concat(b):b).toString(e)},parse:function(a){var a=e.parse(a),c=a.words;if(1398893684==c[0]&&1701076831==c[1]){var d=k.create(c.slice(2,4));c.splice(0,4);a.sigBytes-=16}return b.create({ciphertext:a,salt:d})}},p=i.SerializableCipher=j.extend({cfg:j.extend({format:c}),encrypt:function(a,c,d,f){var f=this.cfg.extend(f),e=a.createEncryptor(d,f),c=e.finalize(c),e=e.cfg;return b.create({ciphertext:c,key:d,iv:e.iv,algorithm:a,mode:e.mode, +padding:e.padding,blockSize:a.blockSize,formatter:f.format})},decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);return a.createDecryptor(c,d).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),l=(l.kdf={}).OpenSSL={execute:function(c,d,f,e){e||(e=k.random(8));c=a.create({keySize:d+f}).compute(c,e);f=k.create(c.words.slice(d),4*f);c.sigBytes=4*d;return b.create({key:c,iv:f,salt:e})}},r=i.PasswordBasedCipher=p.extend({cfg:p.cfg.extend({kdf:l}), +encrypt:function(a,b,c,d){d=this.cfg.extend(d);c=d.kdf.execute(c,a.keySize,a.ivSize);d.iv=c.iv;a=p.encrypt.call(this,a,b,c.key,d);a.mixIn(c);return a},decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);c=d.kdf.execute(c,a.keySize,a.ivSize,b.salt);d.iv=c.iv;return p.decrypt.call(this,a,b,c.key,d)}})}(); +(function(){function n(){for(var a=this._X,f=this._C,c=0;8>c;c++)k[c]=f[c];f[0]=f[0]+1295307597+this._b|0;f[1]=f[1]+3545052371+(f[0]>>>0>>0?1:0)|0;f[2]=f[2]+886263092+(f[1]>>>0>>0?1:0)|0;f[3]=f[3]+1295307597+(f[2]>>>0>>0?1:0)|0;f[4]=f[4]+3545052371+(f[3]>>>0>>0?1:0)|0;f[5]=f[5]+886263092+(f[4]>>>0>>0?1:0)|0;f[6]=f[6]+1295307597+(f[5]>>>0>>0?1:0)|0;f[7]=f[7]+3545052371+(f[6]>>>0>>0?1:0)|0;this._b=f[7]>>>0>>0?1:0;for(c=0;8>c;c++){var e=a[c]+f[c],i=e&65535, +b=e>>>16;d[c]=((i*i>>>17)+i*b>>>15)+b*b^((e&4294901760)*e|0)+((e&65535)*e|0)}a[0]=d[0]+(d[7]<<16|d[7]>>>16)+(d[6]<<16|d[6]>>>16)|0;a[1]=d[1]+(d[0]<<8|d[0]>>>24)+d[7]|0;a[2]=d[2]+(d[1]<<16|d[1]>>>16)+(d[0]<<16|d[0]>>>16)|0;a[3]=d[3]+(d[2]<<8|d[2]>>>24)+d[1]|0;a[4]=d[4]+(d[3]<<16|d[3]>>>16)+(d[2]<<16|d[2]>>>16)|0;a[5]=d[5]+(d[4]<<8|d[4]>>>24)+d[3]|0;a[6]=d[6]+(d[5]<<16|d[5]>>>16)+(d[4]<<16|d[4]>>>16)|0;a[7]=d[7]+(d[6]<<8|d[6]>>>24)+d[5]|0}var l=CryptoJS,i=l.lib.StreamCipher,j=[],k=[],d=[],e=l.algo.Rabbit= +i.extend({_doReset:function(){for(var a=this._key.words,d=this.cfg.iv,c=this._X=[a[0],a[3]<<16|a[2]>>>16,a[1],a[0]<<16|a[3]>>>16,a[2],a[1]<<16|a[0]>>>16,a[3],a[2]<<16|a[1]>>>16],a=this._C=[a[2]<<16|a[2]>>>16,a[0]&4294901760|a[1]&65535,a[3]<<16|a[3]>>>16,a[1]&4294901760|a[2]&65535,a[0]<<16|a[0]>>>16,a[2]&4294901760|a[3]&65535,a[1]<<16|a[1]>>>16,a[3]&4294901760|a[0]&65535],e=this._b=0;4>e;e++)n.call(this);for(e=0;8>e;e++)a[e]^=c[e+4&7];if(d){var c=d.words,d=c[0],c=c[1],d=(d<<8|d>>>24)&16711935|(d<< +24|d>>>8)&4278255360,c=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360,e=d>>>16|c&4294901760,i=c<<16|d&65535;a[0]^=d;a[1]^=e;a[2]^=c;a[3]^=i;a[4]^=d;a[5]^=e;a[6]^=c;a[7]^=i;for(e=0;4>e;e++)n.call(this)}},_doProcessBlock:function(a,d){var c=this._X;n.call(this);j[0]=c[0]^c[5]>>>16^c[3]<<16;j[1]=c[2]^c[7]>>>16^c[5]<<16;j[2]=c[4]^c[1]>>>16^c[7]<<16;j[3]=c[6]^c[3]>>>16^c[1]<<16;for(c=0;4>c;c++)j[c]=(j[c]<<8|j[c]>>>24)&16711935|(j[c]<<24|j[c]>>>8)&4278255360,a[d+c]^=j[c]},blockSize:4,ivSize:2});l.Rabbit= +i._createHelper(e)})(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/rc4.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/rc4.js new file mode 100644 index 000000000..806061f19 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/rc4.js @@ -0,0 +1,30 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +var CryptoJS=CryptoJS||function(p,l){var h={},m=h.lib={},n=m.Base=function(){function a(){}return{extend:function(d){a.prototype=this;var c=new a;d&&c.mixIn(d);c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),b=m.WordArray=n.extend({init:function(a,d){a= +this.words=a||[];this.sigBytes=d!=l?d:4*a.length},toString:function(a){return(a||q).stringify(this)},concat:function(a){var d=this.words,c=a.words,g=this.sigBytes,a=a.sigBytes;this.clamp();if(g%4)for(var f=0;f>>2]|=(c[f>>>2]>>>24-8*(f%4)&255)<<24-8*((g+f)%4);else if(65535>>2]=c[f>>>2];else d.push.apply(d,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,d=this.sigBytes;a[d>>>2]&=4294967295<<32-8*(d%4);a.length=p.ceil(d/4)},clone:function(){var a= +n.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var d=[],c=0;c>>2]>>>24-8*(g%4)&255;c.push((f>>>4).toString(16));c.push((f&15).toString(16))}return c.join("")},parse:function(a){for(var d=a.length,c=[],g=0;g>>3]|=parseInt(a.substr(g,2),16)<<24-4*(g%8);return b.create(c,d/2)}},j=i.Latin1={stringify:function(a){for(var d= +a.words,a=a.sigBytes,c=[],g=0;g>>2]>>>24-8*(g%4)&255));return c.join("")},parse:function(a){for(var d=a.length,c=[],g=0;g>>2]|=(a.charCodeAt(g)&255)<<24-8*(g%4);return b.create(c,d)}},k=i.Utf8={stringify:function(a){try{return decodeURIComponent(escape(j.stringify(a)))}catch(d){throw Error("Malformed UTF-8 data");}},parse:function(a){return j.parse(unescape(encodeURIComponent(a)))}},e=m.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=b.create(); +this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=k.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var d=this._data,c=d.words,g=d.sigBytes,f=this.blockSize,o=g/(4*f),o=a?p.ceil(o):p.max((o|0)-this._minBufferSize,0),a=o*f,g=p.min(4*a,g);if(a){for(var e=0;e>>2]>>>24-8*(i%4)&255)<<16|(m[i+1>>>2]>>>24-8*((i+1)%4)&255)<<8|m[i+2>>>2]>>>24-8*((i+2)%4)&255,j=0;4>j&&i+0.75*j>>6*(3-j)&63));if(m=b.charAt(64))for(;h.length%4;)h.push(m);return h.join("")},parse:function(h){var m=h.length,n=this._map,b=n.charAt(64);b&&(b=h.indexOf(b),-1!=b&&(m=b));for(var b=[],i=0,q=0;q< +m;q++)if(q%4){var j=n.indexOf(h.charAt(q-1))<<2*(q%4),k=n.indexOf(h.charAt(q))>>>6-2*(q%4);b[i>>>2]|=(j|k)<<24-8*(i%4);i++}return l.create(b,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})(); +(function(p){function l(e,b,a,d,c,g,f){e=e+(b&a|~b&d)+c+f;return(e<>>32-g)+b}function h(e,b,a,d,c,g,f){e=e+(b&d|a&~d)+c+f;return(e<>>32-g)+b}function m(e,b,a,d,c,g,f){e=e+(b^a^d)+c+f;return(e<>>32-g)+b}function n(e,b,a,d,c,g,f){e=e+(a^(b|~d))+c+f;return(e<>>32-g)+b}var b=CryptoJS,i=b.lib,q=i.WordArray,i=i.Hasher,j=b.algo,k=[];(function(){for(var e=0;64>e;e++)k[e]=4294967296*p.abs(p.sin(e+1))|0})();j=j.MD5=i.extend({_doReset:function(){this._hash=q.create([1732584193,4023233417, +2562383102,271733878])},_doProcessBlock:function(e,b){for(var a=0;16>a;a++){var d=b+a,c=e[d];e[d]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360}for(var d=this._hash.words,c=d[0],g=d[1],f=d[2],o=d[3],a=0;64>a;a+=4)16>a?(c=l(c,g,f,o,e[b+a],7,k[a]),o=l(o,c,g,f,e[b+a+1],12,k[a+1]),f=l(f,o,c,g,e[b+a+2],17,k[a+2]),g=l(g,f,o,c,e[b+a+3],22,k[a+3])):32>a?(c=h(c,g,f,o,e[b+(a+1)%16],5,k[a]),o=h(o,c,g,f,e[b+(a+6)%16],9,k[a+1]),f=h(f,o,c,g,e[b+(a+11)%16],14,k[a+2]),g=h(g,f,o,c,e[b+a%16],20,k[a+3])):48>a?(c= +m(c,g,f,o,e[b+(3*a+5)%16],4,k[a]),o=m(o,c,g,f,e[b+(3*a+8)%16],11,k[a+1]),f=m(f,o,c,g,e[b+(3*a+11)%16],16,k[a+2]),g=m(g,f,o,c,e[b+(3*a+14)%16],23,k[a+3])):(c=n(c,g,f,o,e[b+3*a%16],6,k[a]),o=n(o,c,g,f,e[b+(3*a+7)%16],10,k[a+1]),f=n(f,o,c,g,e[b+(3*a+14)%16],15,k[a+2]),g=n(g,f,o,c,e[b+(3*a+5)%16],21,k[a+3]));d[0]=d[0]+c|0;d[1]=d[1]+g|0;d[2]=d[2]+f|0;d[3]=d[3]+o|0},_doFinalize:function(){var b=this._data,i=b.words,a=8*this._nDataBytes,d=8*b.sigBytes;i[d>>>5]|=128<<24-d%32;i[(d+64>>>9<<4)+14]=(a<<8|a>>> +24)&16711935|(a<<24|a>>>8)&4278255360;b.sigBytes=4*(i.length+1);this._process();b=this._hash.words;for(i=0;4>i;i++)a=b[i],b[i]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}});b.MD5=i._createHelper(j);b.HmacMD5=i._createHmacHelper(j)})(Math); +(function(){var p=CryptoJS,l=p.lib,h=l.Base,m=l.WordArray,l=p.algo,n=l.EvpKDF=h.extend({cfg:h.extend({keySize:4,hasher:l.MD5,iterations:1}),init:function(b){this.cfg=this.cfg.extend(b)},compute:function(b,i){for(var h=this.cfg,j=h.hasher.create(),k=m.create(),e=k.words,l=h.keySize,h=h.iterations;e.length>>2]&255}};h.BlockCipher=j.extend({cfg:j.cfg.extend({mode:k,padding:r}),reset:function(){j.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var d=a.createEncryptor;else d=a.createDecryptor, +this._minBufferSize=1;this._mode=d.call(a,this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var a=h.CipherParams=m.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),k=(l.format={}).OpenSSL={stringify:function(a){var b= +a.ciphertext,a=a.salt;return(a?n.create([1398893684,1701076831]).concat(a).concat(b):b).toString(i)},parse:function(b){var b=i.parse(b),f=b.words;if(1398893684==f[0]&&1701076831==f[1]){var d=n.create(f.slice(2,4));f.splice(0,4);b.sigBytes-=16}return a.create({ciphertext:b,salt:d})}},d=h.SerializableCipher=m.extend({cfg:m.extend({format:k}),encrypt:function(b,f,d,c){var c=this.cfg.extend(c),e=b.createEncryptor(d,c),f=e.finalize(f),e=e.cfg;return a.create({ciphertext:f,key:d,iv:e.iv,algorithm:b,mode:e.mode, +padding:e.padding,blockSize:b.blockSize,formatter:c.format})},decrypt:function(a,b,d,c){c=this.cfg.extend(c);b=this._parse(b,c.format);return a.createDecryptor(d,c).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),l=(l.kdf={}).OpenSSL={execute:function(b,d,c,e){e||(e=n.random(8));b=q.create({keySize:d+c}).compute(b,e);c=n.create(b.words.slice(d),4*c);b.sigBytes=4*d;return a.create({key:b,iv:c,salt:e})}},c=h.PasswordBasedCipher=d.extend({cfg:d.cfg.extend({kdf:l}), +encrypt:function(a,b,c,e){e=this.cfg.extend(e);c=e.kdf.execute(c,a.keySize,a.ivSize);e.iv=c.iv;a=d.encrypt.call(this,a,b,c.key,e);a.mixIn(c);return a},decrypt:function(a,b,c,e){e=this.cfg.extend(e);b=this._parse(b,e.format);c=e.kdf.execute(c,a.keySize,a.ivSize,b.salt);e.iv=c.iv;return d.decrypt.call(this,a,b,c.key,e)}})}(); +(function(){function p(){for(var b=this._S,i=this._i,h=this._j,j=0,k=0;4>k;k++){var i=(i+1)%256,h=(h+b[i])%256,e=b[i];b[i]=b[h];b[h]=e;j|=b[(b[i]+b[h])%256]<<24-8*k}this._i=i;this._j=h;return j}var l=CryptoJS,h=l.lib.StreamCipher,m=l.algo,n=m.RC4=h.extend({_doReset:function(){for(var b=this._key,i=b.words,b=b.sigBytes,h=this._S=[],j=0;256>j;j++)h[j]=j;for(var k=j=0;256>j;j++){var e=j%b,k=(k+h[j]+(i[e>>>2]>>>24-8*(e%4)&255))%256,e=h[j];h[j]=h[k];h[k]=e}this._i=this._j=0},_doProcessBlock:function(b, +h){b[h]^=p.call(this)},keySize:8,ivSize:0});l.RC4=h._createHelper(n);m=m.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var b=this.cfg.drop;0>>2]|=(c[f>>>2]>>>24-8*(f%4)&255)<<24-8*((d+f)%4);else if(65535>>2]=c[f>>>2];else b.push.apply(b,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-8*(b%4);a.length=i.ceil(b/4)},clone:function(){var a= +n.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],c=0;c>>2]>>>24-8*(d%4)&255;c.push((f>>>4).toString(16));c.push((f&15).toString(16))}return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>3]|=parseInt(a.substr(d,2),16)<<24-4*(d%8);return o.create(c,b/2)}},g=q.Latin1={stringify:function(a){for(var b= +a.words,a=a.sigBytes,c=[],d=0;d>>2]>>>24-8*(d%4)&255));return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return o.create(c,b)}},j=q.Utf8={stringify:function(a){try{return decodeURIComponent(escape(g.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return g.parse(unescape(encodeURIComponent(a)))}},k=h.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=o.create(); +this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=j.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,c=b.words,d=b.sigBytes,f=this.blockSize,e=d/(4*f),e=a?i.ceil(e):i.max((e|0)-this._minBufferSize,0),a=e*f,d=i.min(4*a,d);if(a){for(var g=0;gb;b++){if(16>b)h[b]=o[i+b]|0;else{var c=h[b-3]^h[b-8]^h[b-14]^h[b-16];h[b]=c<<1|c>>>31}c=(g<<5|g>>>27)+a+h[b];c=20>b?c+((j&k|~j&l)+1518500249):40>b?c+((j^k^l)+1859775393):60>b?c+((j&k|j&l|k&l)-1894007588):c+((j^k^l)- +899497514);a=l;l=k;k=j<<30|j>>>2;j=g;g=c}e[0]=e[0]+g|0;e[1]=e[1]+j|0;e[2]=e[2]+k|0;e[3]=e[3]+l|0;e[4]=e[4]+a|0},_doFinalize:function(){var i=this._data,h=i.words,e=8*this._nDataBytes,g=8*i.sigBytes;h[g>>>5]|=128<<24-g%32;h[(g+64>>>9<<4)+15]=e;i.sigBytes=4*h.length;this._process()}});i.SHA1=m._createHelper(n);i.HmacSHA1=m._createHmacHelper(n)})(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/sha224.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/sha224.js new file mode 100644 index 000000000..d84f24b4c --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/sha224.js @@ -0,0 +1,16 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +var CryptoJS=CryptoJS||function(h,l){var f={},g=f.lib={},k=g.Base=function(){function a(){}return{extend:function(i){a.prototype=this;var d=new a;i&&d.mixIn(i);d.$super=this;return d},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var d in a)a.hasOwnProperty(d)&&(this[d]=a[d]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),j=g.WordArray=k.extend({init:function(a,i){a= +this.words=a||[];this.sigBytes=i!=l?i:4*a.length},toString:function(a){return(a||n).stringify(this)},concat:function(a){var i=this.words,d=a.words,c=this.sigBytes,a=a.sigBytes;this.clamp();if(c%4)for(var b=0;b>>2]|=(d[b>>>2]>>>24-8*(b%4)&255)<<24-8*((c+b)%4);else if(65535>>2]=d[b>>>2];else i.push.apply(i,d);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-8*(b%4);a.length=h.ceil(b/4)},clone:function(){var a= +k.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],d=0;d>>2]>>>24-8*(c%4)&255;d.push((e>>>4).toString(16));d.push((e&15).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c>>3]|=parseInt(a.substr(c,2),16)<<24-4*(c%8);return j.create(d,b/2)}},q=p.Latin1={stringify:function(a){for(var b= +a.words,a=a.sigBytes,d=[],c=0;c>>2]>>>24-8*(c%4)&255));return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c>>2]|=(a.charCodeAt(c)&255)<<24-8*(c%4);return j.create(d,b)}},r=p.Utf8={stringify:function(a){try{return decodeURIComponent(escape(q.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return q.parse(unescape(encodeURIComponent(a)))}},b=g.BufferedBlockAlgorithm=k.extend({reset:function(){this._data=j.create(); +this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=r.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,d=b.words,c=b.sigBytes,e=this.blockSize,f=c/(4*e),f=a?h.ceil(f):h.max((f|0)-this._minBufferSize,0),a=f*e,c=h.min(4*a,c);if(a){for(var g=0;ge;)f(b)&&(8>e&&(j[e]=g(h.pow(b,0.5))),p[e]=g(h.pow(b,1/3)),e++),b++})();var n=[],k=k.SHA256=f.extend({_doReset:function(){this._hash=g.create(j.slice(0))},_doProcessBlock:function(f,g){for(var b=this._hash.words,e=b[0],a=b[1],i=b[2],d=b[3],c=b[4],h=b[5],k=b[6],l=b[7],m=0;64> +m;m++){if(16>m)n[m]=f[g+m]|0;else{var j=n[m-15],o=n[m-2];n[m]=((j<<25|j>>>7)^(j<<14|j>>>18)^j>>>3)+n[m-7]+((o<<15|o>>>17)^(o<<13|o>>>19)^o>>>10)+n[m-16]}j=l+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&h^~c&k)+p[m]+n[m];o=((e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22))+(e&a^e&i^a&i);l=k;k=h;h=c;c=d+j|0;d=i;i=a;a=e;e=j+o|0}b[0]=b[0]+e|0;b[1]=b[1]+a|0;b[2]=b[2]+i|0;b[3]=b[3]+d|0;b[4]=b[4]+c|0;b[5]=b[5]+h|0;b[6]=b[6]+k|0;b[7]=b[7]+l|0},_doFinalize:function(){var f=this._data,g=f.words,b=8*this._nDataBytes, +e=8*f.sigBytes;g[e>>>5]|=128<<24-e%32;g[(e+64>>>9<<4)+15]=b;f.sigBytes=4*g.length;this._process()}});l.SHA256=f._createHelper(k);l.HmacSHA256=f._createHmacHelper(k)})(Math); +(function(){var h=CryptoJS,l=h.lib.WordArray,f=h.algo,g=f.SHA256,f=f.SHA224=g.extend({_doReset:function(){this._hash=l.create([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){g._doFinalize.call(this);this._hash.sigBytes-=4}});h.SHA224=g._createHelper(f);h.HmacSHA224=g._createHmacHelper(f)})(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/sha256.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/sha256.js new file mode 100644 index 000000000..0cc458183 --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/sha256.js @@ -0,0 +1,15 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +var CryptoJS=CryptoJS||function(i,p){var f={},q=f.lib={},j=q.Base=function(){function a(){}return{extend:function(h){a.prototype=this;var d=new a;h&&d.mixIn(h);d.$super=this;return d},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var d in a)a.hasOwnProperty(d)&&(this[d]=a[d]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),k=q.WordArray=j.extend({init:function(a,h){a= +this.words=a||[];this.sigBytes=h!=p?h:4*a.length},toString:function(a){return(a||m).stringify(this)},concat:function(a){var h=this.words,d=a.words,c=this.sigBytes,a=a.sigBytes;this.clamp();if(c%4)for(var b=0;b>>2]|=(d[b>>>2]>>>24-8*(b%4)&255)<<24-8*((c+b)%4);else if(65535>>2]=d[b>>>2];else h.push.apply(h,d);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-8*(b%4);a.length=i.ceil(b/4)},clone:function(){var a= +j.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],d=0;d>>2]>>>24-8*(c%4)&255;d.push((e>>>4).toString(16));d.push((e&15).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c>>3]|=parseInt(a.substr(c,2),16)<<24-4*(c%8);return k.create(d,b/2)}},s=r.Latin1={stringify:function(a){for(var b= +a.words,a=a.sigBytes,d=[],c=0;c>>2]>>>24-8*(c%4)&255));return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c>>2]|=(a.charCodeAt(c)&255)<<24-8*(c%4);return k.create(d,b)}},g=r.Utf8={stringify:function(a){try{return decodeURIComponent(escape(s.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return s.parse(unescape(encodeURIComponent(a)))}},b=q.BufferedBlockAlgorithm=j.extend({reset:function(){this._data=k.create(); +this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=g.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,d=b.words,c=b.sigBytes,e=this.blockSize,f=c/(4*e),f=a?i.ceil(f):i.max((f|0)-this._minBufferSize,0),a=f*e,c=i.min(4*a,c);if(a){for(var g=0;ge;)f(b)&&(8>e&&(k[e]=g(i.pow(b,0.5))),r[e]=g(i.pow(b,1/3)),e++),b++})();var m=[],j=j.SHA256=f.extend({_doReset:function(){this._hash=q.create(k.slice(0))},_doProcessBlock:function(f,g){for(var b=this._hash.words,e=b[0],a=b[1],h=b[2],d=b[3],c=b[4],i=b[5],j=b[6],k=b[7],l=0;64> +l;l++){if(16>l)m[l]=f[g+l]|0;else{var n=m[l-15],o=m[l-2];m[l]=((n<<25|n>>>7)^(n<<14|n>>>18)^n>>>3)+m[l-7]+((o<<15|o>>>17)^(o<<13|o>>>19)^o>>>10)+m[l-16]}n=k+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&i^~c&j)+r[l]+m[l];o=((e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22))+(e&a^e&h^a&h);k=j;j=i;i=c;c=d+n|0;d=h;h=a;a=e;e=n+o|0}b[0]=b[0]+e|0;b[1]=b[1]+a|0;b[2]=b[2]+h|0;b[3]=b[3]+d|0;b[4]=b[4]+c|0;b[5]=b[5]+i|0;b[6]=b[6]+j|0;b[7]=b[7]+k|0},_doFinalize:function(){var f=this._data,g=f.words,b=8*this._nDataBytes, +e=8*f.sigBytes;g[e>>>5]|=128<<24-e%32;g[(e+64>>>9<<4)+15]=b;f.sigBytes=4*g.length;this._process()}});p.SHA256=f._createHelper(j);p.HmacSHA256=f._createHmacHelper(j)})(Math); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/sha384.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/sha384.js new file mode 100644 index 000000000..31a7cc87f --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/sha384.js @@ -0,0 +1,25 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +var CryptoJS=CryptoJS||function(a,b){var c={},g=c.lib={},l=g.Base=function(){function a(){}return{extend:function(d){a.prototype=this;var f=new a;d&&f.mixIn(d);f.$super=this;return f},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var k in a)a.hasOwnProperty(k)&&(this[k]=a[k]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),t=g.WordArray=l.extend({init:function(a,d){a= +this.words=a||[];this.sigBytes=d!=b?d:4*a.length},toString:function(a){return(a||w).stringify(this)},concat:function(a){var d=this.words,f=a.words,e=this.sigBytes,a=a.sigBytes;this.clamp();if(e%4)for(var i=0;i>>2]|=(f[i>>>2]>>>24-8*(i%4)&255)<<24-8*((e+i)%4);else if(65535>>2]=f[i>>>2];else d.push.apply(d,f);this.sigBytes+=a;return this},clamp:function(){var k=this.words,d=this.sigBytes;k[d>>>2]&=4294967295<<32-8*(d%4);k.length=a.ceil(d/4)},clone:function(){var a= +l.clone.call(this);a.words=this.words.slice(0);return a},random:function(k){for(var d=[],f=0;f>>2]>>>24-8*(e%4)&255;f.push((i>>>4).toString(16));f.push((i&15).toString(16))}return f.join("")},parse:function(a){for(var d=a.length,f=[],e=0;e>>3]|=parseInt(a.substr(e,2),16)<<24-4*(e%8);return t.create(f,d/2)}},m=C.Latin1={stringify:function(a){for(var d= +a.words,a=a.sigBytes,f=[],e=0;e>>2]>>>24-8*(e%4)&255));return f.join("")},parse:function(a){for(var d=a.length,f=[],e=0;e>>2]|=(a.charCodeAt(e)&255)<<24-8*(e%4);return t.create(f,d)}},ea=C.Utf8={stringify:function(a){try{return decodeURIComponent(escape(m.stringify(a)))}catch(d){throw Error("Malformed UTF-8 data");}},parse:function(a){return m.parse(unescape(encodeURIComponent(a)))}},T=g.BufferedBlockAlgorithm=l.extend({reset:function(){this._data= +t.create();this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=ea.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(k){var d=this._data,f=d.words,e=d.sigBytes,i=this.blockSize,b=e/(4*i),b=k?a.ceil(b):a.max((b|0)-this._minBufferSize,0),k=b*i,e=a.min(4*k,e);if(k){for(var m=0;mb;b++)w[b]=a()})();g=g.SHA512=c.extend({_doReset:function(){this._hash=t.create([a(1779033703,4089235720),a(3144134277,2227873595),a(1013904242,4271175723),a(2773480762,1595750129),a(1359893119,2917565137),a(2600822924,725511199),a(528734635,4215389547),a(1541459225,327033209)])},_doProcessBlock:function(a,b){for(var c=this._hash.words,g=c[0],k=c[1],d=c[2],f=c[3],e=c[4],i=c[5],l= +c[6],c=c[7],t=g.high,J=g.low,X=k.high,K=k.low,Y=d.high,L=d.low,Z=f.high,M=f.low,$=e.high,N=e.low,aa=i.high,O=i.low,ba=l.high,P=l.low,ca=c.high,Q=c.low,q=t,n=J,D=X,A=K,E=Y,B=L,U=Z,F=M,r=$,o=N,R=aa,G=O,S=ba,H=P,V=ca,I=Q,s=0;80>s;s++){var x=w[s];if(16>s)var p=x.high=a[b+2*s]|0,h=x.low=a[b+2*s+1]|0;else{var p=w[s-15],h=p.high,u=p.low,p=(h>>>1|u<<31)^(h>>>8|u<<24)^h>>>7,u=(u>>>1|h<<31)^(u>>>8|h<<24)^(u>>>7|h<<25),z=w[s-2],h=z.high,j=z.low,z=(h>>>19|j<<13)^(h<<3|j>>>29)^h>>>6,j=(j>>>19|h<<13)^(j<<3|h>>> +29)^(j>>>6|h<<26),h=w[s-7],W=h.high,y=w[s-16],v=y.high,y=y.low,h=u+h.low,p=p+W+(h>>>0>>0?1:0),h=h+j,p=p+z+(h>>>0>>0?1:0),h=h+y,p=p+v+(h>>>0>>0?1:0);x.high=p;x.low=h}var W=r&R^~r&S,y=o&G^~o&H,x=q&D^q&E^D&E,ga=n&A^n&B^A&B,u=(q>>>28|n<<4)^(q<<30|n>>>2)^(q<<25|n>>>7),z=(n>>>28|q<<4)^(n<<30|q>>>2)^(n<<25|q>>>7),j=C[s],ha=j.high,da=j.low,j=I+((o>>>14|r<<18)^(o>>>18|r<<14)^(o<<23|r>>>9)),v=V+((r>>>14|o<<18)^(r>>>18|o<<14)^(r<<23|o>>>9))+(j>>>0>>0?1:0),j=j+y,v=v+W+(j>>>0>>0?1:0),j=j+da,v=v+ +ha+(j>>>0>>0?1:0),j=j+h,v=v+p+(j>>>0>>0?1:0),h=z+ga,x=u+x+(h>>>0>>0?1:0),V=S,I=H,S=R,H=G,R=r,G=o,o=F+j|0,r=U+v+(o>>>0>>0?1:0)|0,U=E,F=B,E=D,B=A,D=q,A=n,n=j+h|0,q=v+x+(n>>>0>>0?1:0)|0}J=g.low=J+n;g.high=t+q+(J>>>0>>0?1:0);K=k.low=K+A;k.high=X+D+(K>>>0>>0?1:0);L=d.low=L+B;d.high=Y+E+(L>>>0>>0?1:0);M=f.low=M+F;f.high=Z+U+(M>>>0>>0?1:0);N=e.low=N+o;e.high=$+r+(N>>>0>>0?1:0);O=i.low=O+G;i.high=aa+R+(O>>>0>>0?1:0);P=l.low=P+H;l.high=ba+S+(P>>>0>>0?1:0);Q=c.low=Q+I;c.high= +ca+V+(Q>>>0>>0?1:0)},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,g=8*a.sigBytes;b[g>>>5]|=128<<24-g%32;b[(g+128>>>10<<5)+31]=c;a.sigBytes=4*b.length;this._process();this._hash=this._hash.toX32()},blockSize:32});b.SHA512=c._createHelper(g);b.HmacSHA512=c._createHmacHelper(g)})(); +(function(){var a=CryptoJS,b=a.x64,c=b.Word,g=b.WordArray,b=a.algo,l=b.SHA512,b=b.SHA384=l.extend({_doReset:function(){this._hash=g.create([c.create(3418070365,3238371032),c.create(1654270250,914150663),c.create(2438529370,812702999),c.create(355462360,4144912697),c.create(1731405415,4290775857),c.create(2394180231,1750603025),c.create(3675008525,1694076839),c.create(1203062813,3204075428)])},_doFinalize:function(){l._doFinalize.call(this);this._hash.sigBytes-=16}});a.SHA384=l._createHelper(b);a.HmacSHA384= +l._createHmacHelper(b)})(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/sha512.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/sha512.js new file mode 100644 index 000000000..58bb7092f --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/sha512.js @@ -0,0 +1,23 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +var CryptoJS=CryptoJS||function(a,g){var m={},e=m.lib={},q=e.Base=function(){function a(){}return{extend:function(b){a.prototype=this;var d=new a;b&&d.mixIn(b);d.$super=this;return d},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var k in a)a.hasOwnProperty(k)&&(this[k]=a[k]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),r=e.WordArray=q.extend({init:function(a,b){a= +this.words=a||[];this.sigBytes=b!=g?b:4*a.length},toString:function(a){return(a||n).stringify(this)},concat:function(a){var b=this.words,d=a.words,c=this.sigBytes,a=a.sigBytes;this.clamp();if(c%4)for(var i=0;i>>2]|=(d[i>>>2]>>>24-8*(i%4)&255)<<24-8*((c+i)%4);else if(65535>>2]=d[i>>>2];else b.push.apply(b,d);this.sigBytes+=a;return this},clamp:function(){var k=this.words,b=this.sigBytes;k[b>>>2]&=4294967295<<32-8*(b%4);k.length=a.ceil(b/4)},clone:function(){var a= +q.clone.call(this);a.words=this.words.slice(0);return a},random:function(k){for(var b=[],d=0;d>>2]>>>24-8*(c%4)&255;d.push((i>>>4).toString(16));d.push((i&15).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c>>3]|=parseInt(a.substr(c,2),16)<<24-4*(c%8);return r.create(d,b/2)}},l=y.Latin1={stringify:function(a){for(var b= +a.words,a=a.sigBytes,d=[],c=0;c>>2]>>>24-8*(c%4)&255));return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c>>2]|=(a.charCodeAt(c)&255)<<24-8*(c%4);return r.create(d,b)}},da=y.Utf8={stringify:function(a){try{return decodeURIComponent(escape(l.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return l.parse(unescape(encodeURIComponent(a)))}},h=e.BufferedBlockAlgorithm=q.extend({reset:function(){this._data= +r.create();this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=da.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(k){var b=this._data,d=b.words,c=b.sigBytes,i=this.blockSize,l=c/(4*i),l=k?a.ceil(l):a.max((l|0)-this._minBufferSize,0),k=l*i,c=a.min(4*k,c);if(k){for(var h=0;hl;l++)n[l]=a()})();e=e.SHA512=m.extend({_doReset:function(){this._hash=r.create([a(1779033703,4089235720),a(3144134277,2227873595),a(1013904242,4271175723),a(2773480762,1595750129),a(1359893119,2917565137),a(2600822924,725511199),a(528734635,4215389547),a(1541459225,327033209)])},_doProcessBlock:function(a,e){for(var h=this._hash.words,g=h[0],k=h[1],b=h[2],d=h[3],c=h[4],i=h[5],m= +h[6],h=h[7],q=g.high,r=g.low,W=k.high,K=k.low,X=b.high,L=b.low,Y=d.high,M=d.low,Z=c.high,N=c.low,$=i.high,O=i.low,aa=m.high,P=m.low,ba=h.high,Q=h.low,t=q,o=r,E=W,C=K,F=X,D=L,T=Y,G=M,u=Z,p=N,R=$,H=O,S=aa,I=P,U=ba,J=Q,v=0;80>v;v++){var z=n[v];if(16>v)var s=z.high=a[e+2*v]|0,f=z.low=a[e+2*v+1]|0;else{var s=n[v-15],f=s.high,w=s.low,s=(f>>>1|w<<31)^(f>>>8|w<<24)^f>>>7,w=(w>>>1|f<<31)^(w>>>8|f<<24)^(w>>>7|f<<25),B=n[v-2],f=B.high,j=B.low,B=(f>>>19|j<<13)^(f<<3|j>>>29)^f>>>6,j=(j>>>19|f<<13)^(j<<3|f>>>29)^ +(j>>>6|f<<26),f=n[v-7],V=f.high,A=n[v-16],x=A.high,A=A.low,f=w+f.low,s=s+V+(f>>>0>>0?1:0),f=f+j,s=s+B+(f>>>0>>0?1:0),f=f+A,s=s+x+(f>>>0>>0?1:0);z.high=s;z.low=f}var V=u&R^~u&S,A=p&H^~p&I,z=t&E^t&F^E&F,fa=o&C^o&D^C&D,w=(t>>>28|o<<4)^(t<<30|o>>>2)^(t<<25|o>>>7),B=(o>>>28|t<<4)^(o<<30|t>>>2)^(o<<25|t>>>7),j=y[v],ga=j.high,ca=j.low,j=J+((p>>>14|u<<18)^(p>>>18|u<<14)^(p<<23|u>>>9)),x=U+((u>>>14|p<<18)^(u>>>18|p<<14)^(u<<23|p>>>9))+(j>>>0>>0?1:0),j=j+A,x=x+V+(j>>>0>>0?1:0),j=j+ca,x=x+ga+ +(j>>>0>>0?1:0),j=j+f,x=x+s+(j>>>0>>0?1:0),f=B+fa,z=w+z+(f>>>0>>0?1:0),U=S,J=I,S=R,I=H,R=u,H=p,p=G+j|0,u=T+x+(p>>>0>>0?1:0)|0,T=F,G=D,F=E,D=C,E=t,C=o,o=j+f|0,t=x+z+(o>>>0>>0?1:0)|0}r=g.low=r+o;g.high=q+t+(r>>>0>>0?1:0);K=k.low=K+C;k.high=W+E+(K>>>0>>0?1:0);L=b.low=L+D;b.high=X+F+(L>>>0>>0?1:0);M=d.low=M+G;d.high=Y+T+(M>>>0>>0?1:0);N=c.low=N+p;c.high=Z+u+(N>>>0

>>0?1:0);O=i.low=O+H;i.high=$+R+(O>>>0>>0?1:0);P=m.low=P+I;m.high=aa+S+(P>>>0>>0?1:0);Q=h.low=Q+J;h.high= +ba+U+(Q>>>0>>0?1:0)},_doFinalize:function(){var a=this._data,e=a.words,h=8*this._nDataBytes,g=8*a.sigBytes;e[g>>>5]|=128<<24-g%32;e[(g+128>>>10<<5)+31]=h;a.sigBytes=4*e.length;this._process();this._hash=this._hash.toX32()},blockSize:32});g.SHA512=m._createHelper(e);g.HmacSHA512=m._createHmacHelper(e)})(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/tripledes.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/tripledes.js new file mode 100644 index 000000000..392af39ea --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/CryptoJS-v3.0.1/rollups/tripledes.js @@ -0,0 +1,48 @@ +/* +CryptoJS v3.0.1 +code.google.com/p/crypto-js +(c) 2009-2012 by Jeff Mott. All rights reserved. +code.google.com/p/crypto-js/wiki/License +*/ +var CryptoJS=CryptoJS||function(q,i){var h={},j=h.lib={},p=j.Base=function(){function a(){}return{extend:function(c){a.prototype=this;var b=new a;c&&b.mixIn(c);b.$super=this;return b},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),l=j.WordArray=p.extend({init:function(a,c){a= +this.words=a||[];this.sigBytes=c!=i?c:4*a.length},toString:function(a){return(a||r).stringify(this)},concat:function(a){var c=this.words,b=a.words,g=this.sigBytes,a=a.sigBytes;this.clamp();if(g%4)for(var e=0;e>>2]|=(b[e>>>2]>>>24-8*(e%4)&255)<<24-8*((g+e)%4);else if(65535>>2]=b[e>>>2];else c.push.apply(c,b);this.sigBytes+=a;return this},clamp:function(){var a=this.words,c=this.sigBytes;a[c>>>2]&=4294967295<<32-8*(c%4);a.length=q.ceil(c/4)},clone:function(){var a= +p.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var c=[],b=0;b>>2]>>>24-8*(g%4)&255;b.push((e>>>4).toString(16));b.push((e&15).toString(16))}return b.join("")},parse:function(a){for(var c=a.length,b=[],g=0;g>>3]|=parseInt(a.substr(g,2),16)<<24-4*(g%8);return l.create(b,c/2)}},o=k.Latin1={stringify:function(a){for(var c= +a.words,a=a.sigBytes,b=[],g=0;g>>2]>>>24-8*(g%4)&255));return b.join("")},parse:function(a){for(var c=a.length,b=[],g=0;g>>2]|=(a.charCodeAt(g)&255)<<24-8*(g%4);return l.create(b,c)}},m=k.Utf8={stringify:function(a){try{return decodeURIComponent(escape(o.stringify(a)))}catch(c){throw Error("Malformed UTF-8 data");}},parse:function(a){return o.parse(unescape(encodeURIComponent(a)))}},d=j.BufferedBlockAlgorithm=p.extend({reset:function(){this._data=l.create(); +this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=m.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var c=this._data,b=c.words,g=c.sigBytes,e=this.blockSize,n=g/(4*e),n=a?q.ceil(n):q.max((n|0)-this._minBufferSize,0),a=n*e,g=q.min(4*a,g);if(a){for(var d=0;d>>2]>>>24-8*(k%4)&255)<<16|(j[k+1>>>2]>>>24-8*((k+1)%4)&255)<<8|j[k+2>>>2]>>>24-8*((k+2)%4)&255,o=0;4>o&&k+0.75*o>>6*(3-o)&63));if(j=l.charAt(64))for(;h.length%4;)h.push(j);return h.join("")},parse:function(h){var j=h.length,p=this._map,l=p.charAt(64);l&&(l=h.indexOf(l),-1!=l&&(j=l));for(var l=[],k=0,r=0;r< +j;r++)if(r%4){var o=p.indexOf(h.charAt(r-1))<<2*(r%4),m=p.indexOf(h.charAt(r))>>>6-2*(r%4);l[k>>>2]|=(o|m)<<24-8*(k%4);k++}return i.create(l,k)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})(); +(function(q){function i(d,f,a,c,b,g,e){d=d+(f&a|~f&c)+b+e;return(d<>>32-g)+f}function h(d,f,a,c,b,g,e){d=d+(f&c|a&~c)+b+e;return(d<>>32-g)+f}function j(d,f,a,c,b,g,e){d=d+(f^a^c)+b+e;return(d<>>32-g)+f}function p(d,f,a,c,b,g,e){d=d+(a^(f|~c))+b+e;return(d<>>32-g)+f}var l=CryptoJS,k=l.lib,r=k.WordArray,k=k.Hasher,o=l.algo,m=[];(function(){for(var d=0;64>d;d++)m[d]=4294967296*q.abs(q.sin(d+1))|0})();o=o.MD5=k.extend({_doReset:function(){this._hash=r.create([1732584193,4023233417, +2562383102,271733878])},_doProcessBlock:function(d,f){for(var a=0;16>a;a++){var c=f+a,b=d[c];d[c]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360}for(var c=this._hash.words,b=c[0],g=c[1],e=c[2],n=c[3],a=0;64>a;a+=4)16>a?(b=i(b,g,e,n,d[f+a],7,m[a]),n=i(n,b,g,e,d[f+a+1],12,m[a+1]),e=i(e,n,b,g,d[f+a+2],17,m[a+2]),g=i(g,e,n,b,d[f+a+3],22,m[a+3])):32>a?(b=h(b,g,e,n,d[f+(a+1)%16],5,m[a]),n=h(n,b,g,e,d[f+(a+6)%16],9,m[a+1]),e=h(e,n,b,g,d[f+(a+11)%16],14,m[a+2]),g=h(g,e,n,b,d[f+a%16],20,m[a+3])):48>a?(b= +j(b,g,e,n,d[f+(3*a+5)%16],4,m[a]),n=j(n,b,g,e,d[f+(3*a+8)%16],11,m[a+1]),e=j(e,n,b,g,d[f+(3*a+11)%16],16,m[a+2]),g=j(g,e,n,b,d[f+(3*a+14)%16],23,m[a+3])):(b=p(b,g,e,n,d[f+3*a%16],6,m[a]),n=p(n,b,g,e,d[f+(3*a+7)%16],10,m[a+1]),e=p(e,n,b,g,d[f+(3*a+14)%16],15,m[a+2]),g=p(g,e,n,b,d[f+(3*a+5)%16],21,m[a+3]));c[0]=c[0]+b|0;c[1]=c[1]+g|0;c[2]=c[2]+e|0;c[3]=c[3]+n|0},_doFinalize:function(){var d=this._data,f=d.words,a=8*this._nDataBytes,c=8*d.sigBytes;f[c>>>5]|=128<<24-c%32;f[(c+64>>>9<<4)+14]=(a<<8|a>>> +24)&16711935|(a<<24|a>>>8)&4278255360;d.sigBytes=4*(f.length+1);this._process();d=this._hash.words;for(f=0;4>f;f++)a=d[f],d[f]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}});l.MD5=k._createHelper(o);l.HmacMD5=k._createHmacHelper(o)})(Math); +(function(){var q=CryptoJS,i=q.lib,h=i.Base,j=i.WordArray,i=q.algo,p=i.EvpKDF=h.extend({cfg:h.extend({keySize:4,hasher:i.MD5,iterations:1}),init:function(h){this.cfg=this.cfg.extend(h)},compute:function(h,k){for(var i=this.cfg,o=i.hasher.create(),m=j.create(),d=m.words,f=i.keySize,i=i.iterations;d.length>>2]&255}};h.BlockCipher=o.extend({cfg:o.cfg.extend({mode:m,padding:f}),reset:function(){o.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=a.createEncryptor;else c=a.createDecryptor, +this._minBufferSize=1;this._mode=c.call(a,this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var a=h.CipherParams=j.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),m=(i.format={}).OpenSSL={stringify:function(a){var b= +a.ciphertext,a=a.salt;return(a?p.create([1398893684,1701076831]).concat(a).concat(b):b).toString(k)},parse:function(b){var b=k.parse(b),e=b.words;if(1398893684==e[0]&&1701076831==e[1]){var c=p.create(e.slice(2,4));e.splice(0,4);b.sigBytes-=16}return a.create({ciphertext:b,salt:c})}},c=h.SerializableCipher=j.extend({cfg:j.extend({format:m}),encrypt:function(b,e,c,d){var d=this.cfg.extend(d),f=b.createEncryptor(c,d),e=f.finalize(e),f=f.cfg;return a.create({ciphertext:e,key:c,iv:f.iv,algorithm:b,mode:f.mode, +padding:f.padding,blockSize:b.blockSize,formatter:d.format})},decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);return a.createDecryptor(c,d).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a,this):a}}),i=(i.kdf={}).OpenSSL={execute:function(b,c,d,f){f||(f=p.random(8));b=r.create({keySize:c+d}).compute(b,f);d=p.create(b.words.slice(c),4*d);b.sigBytes=4*c;return a.create({key:b,iv:d,salt:f})}},b=h.PasswordBasedCipher=c.extend({cfg:c.cfg.extend({kdf:i}), +encrypt:function(a,b,d,f){f=this.cfg.extend(f);d=f.kdf.execute(d,a.keySize,a.ivSize);f.iv=d.iv;a=c.encrypt.call(this,a,b,d.key,f);a.mixIn(d);return a},decrypt:function(a,b,d,f){f=this.cfg.extend(f);b=this._parse(b,f.format);d=f.kdf.execute(d,a.keySize,a.ivSize,b.salt);f.iv=d.iv;return c.decrypt.call(this,a,b,d.key,f)}})}(); +(function(){function q(a,c){var b=(this._lBlock>>>a^this._rBlock)&c;this._rBlock^=b;this._lBlock^=b<>>a^this._lBlock)&c;this._lBlock^=b;this._rBlock^=b<b;b++){var d=k[b]-1;c[b]=a[d>>>5]>>>31-d%32&1}a=this._subKeys=[];for(d=0;16>d;d++){for(var e=a[d]=[],f=o[d],b=0;24>b;b++)e[b/6|0]|=c[(r[b]-1+f)%28]<<31-b%6,e[4+(b/6|0)]|=c[28+(r[b+24]-1+f)%28]<<31-b%6;e[0]=e[0]<<1|e[0]>>>31;for(b=1;7>b;b++)e[b]>>>= +4*(b-1)+3;e[7]=e[7]<<5|e[7]>>>27}c=this._invSubKeys=[];for(b=0;16>b;b++)c[b]=a[15-b]},encryptBlock:function(a,c){this._doCryptBlock(a,c,this._subKeys)},decryptBlock:function(a,c){this._doCryptBlock(a,c,this._invSubKeys)},_doCryptBlock:function(a,c,b){this._lBlock=a[c];this._rBlock=a[c+1];q.call(this,4,252645135);q.call(this,16,65535);i.call(this,2,858993459);i.call(this,8,16711935);q.call(this,1,1431655765);for(var f=0;16>f;f++){for(var e=b[f],h=this._lBlock,j=this._rBlock,k=0,l=0;8>l;l++)k|=m[l][((j^ +e[l])&d[l])>>>0];this._lBlock=j;this._rBlock=h^k}b=this._lBlock;this._lBlock=this._rBlock;this._rBlock=b;q.call(this,1,1431655765);i.call(this,8,16711935);i.call(this,2,858993459);q.call(this,16,65535);q.call(this,4,252645135);a[c]=this._lBlock;a[c+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});h.DES=j._createHelper(f);l=l.TripleDES=j.extend({_doReset:function(){var a=this._key.words;this._des1=f.createEncryptor(p.create(a.slice(0,2)));this._des2=f.createEncryptor(p.create(a.slice(2,4)));this._des3= +f.createEncryptor(p.create(a.slice(4,6)))},encryptBlock:function(a,c){this._des1.encryptBlock(a,c);this._des2.decryptBlock(a,c);this._des3.encryptBlock(a,c)},decryptBlock:function(a,c){this._des3.decryptBlock(a,c);this._des2.encryptBlock(a,c);this._des1.decryptBlock(a,c)},keySize:6,ivSize:2,blockSize:2});h.TripleDES=j._createHelper(l)})(); diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/jquery.base64.js b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/jquery.base64.js new file mode 100644 index 000000000..b2fccb4ad --- /dev/null +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/static/libs/jquery.base64.js @@ -0,0 +1,143 @@ +/** + * jQuery BASE64 functions + * + * + * Encodes the given data with base64. + * String $.base64Encode ( String str ) + *
+ * Decodes a base64 encoded data. + * String $.base64Decode ( String str ) + *
+ * + * Encodes and Decodes the given data in base64. This encoding is designed to + * make binary data survive transport through transport layers that are not + * 8-bit clean, such as mail bodies. Base64-encoded data takes about 33% more + * space than the original data. This javascript code is used to encode / decode + * data using base64 (this encoding is designed to make binary data survive + * transport through transport layers that are not 8-bit clean). Script is fully + * compatible with UTF-8 encoding. You can use base64 encoded data as simple + * encryption mechanism. If you plan using UTF-8 encoding in your project don't + * forget to set the page encoding to UTF-8 (Content-Type meta tag). This + * function orginally get from the WebToolkit and rewrite for using as the + * jQuery plugin. + * + * Example Code + * $.base64Encode("I'm Persian."); + * Result + * "SSdtIFBlcnNpYW4u" + * + * Code + * $.base64Decode("SSdtIFBlcnNpYW4u"); + * Result + * "I'm Persian." + * + * + * @alias Muhammad Hussein Fattahizadeh < muhammad [AT] semnanweb [DOT] com > + * @link http://www.semnanweb.com/jquery-plugin/base64.html + * @see http://www.webtoolkit.info/ + * @license http://www.gnu.org/licenses/gpl.html [GNU General Public License] + * @param {jQuery} + * {base64Encode:function(input)) + * @param {jQuery} + * {base64Decode:function(input)) + * @return string + */ +(function($) { + + var keyString = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + + var uTF8Encode = function(string) { + string = string.replace(/\x0d\x0a/g, "\x0a"); + var output = ""; + for ( var n = 0; n < string.length; n++) { + var c = string.charCodeAt(n); + if (c < 128) { + output += String.fromCharCode(c); + } else if ((c > 127) && (c < 2048)) { + output += String.fromCharCode((c >> 6) | 192); + output += String.fromCharCode((c & 63) | 128); + } else { + output += String.fromCharCode((c >> 12) | 224); + output += String.fromCharCode(((c >> 6) & 63) | 128); + output += String.fromCharCode((c & 63) | 128); + } + } + return output; + }; + + var uTF8Decode = function(input) { + var string = ""; + var i = 0; + var c = c1 = c2 = 0; + while (i < input.length) { + c = input.charCodeAt(i); + if (c < 128) { + string += String.fromCharCode(c); + i++; + } else if ((c > 191) && (c < 224)) { + c2 = input.charCodeAt(i + 1); + string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + i += 2; + } else { + c2 = input.charCodeAt(i + 1); + c3 = input.charCodeAt(i + 2); + string += String.fromCharCode(((c & 15) << 12) + | ((c2 & 63) << 6) | (c3 & 63)); + i += 3; + } + } + return string; + } + + $.extend({ + base64Encode : function(input) { + var output = ""; + var chr1, chr2, chr3, enc1, enc2, enc3, enc4; + var i = 0; + input = uTF8Encode(input); + while (i < input.length) { + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + output = output + keyString.charAt(enc1) + + keyString.charAt(enc2) + keyString.charAt(enc3) + + keyString.charAt(enc4); + } + return output; + }, + base64Decode : function(input) { + var output = ""; + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i = 0; + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + while (i < input.length) { + enc1 = keyString.indexOf(input.charAt(i++)); + enc2 = keyString.indexOf(input.charAt(i++)); + enc3 = keyString.indexOf(input.charAt(i++)); + enc4 = keyString.indexOf(input.charAt(i++)); + chr1 = (enc1 << 2) | (enc2 >> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + output = output + String.fromCharCode(chr1); + if (enc3 != 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 != 64) { + output = output + String.fromCharCode(chr3); + } + } + output = uTF8Decode(output); + return output; + } + }); +})(jQuery); \ No newline at end of file diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/client/viewClientAccount.jsp b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/client/viewClientAccount.jsp index a3d3334b0..2633f5f21 100644 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/client/viewClientAccount.jsp +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/client/viewClientAccount.jsp @@ -21,6 +21,8 @@ div.notespacer {margin-top: 5px; margin-bottom: 5px;} - + diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/common-head.jsp b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/common-head.jsp index 3e7d623ac..ae46124a5 100644 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/common-head.jsp +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/common-head.jsp @@ -35,6 +35,7 @@ + diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/home.jsp b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/home.jsp index 78a118151..734cbbfd9 100644 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/home.jsp +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/home.jsp @@ -206,6 +206,11 @@ $(document).ready(function() { contentType: 'application/json', dataType: 'json', cache: false, + beforeSend: function(xhr) { + var base64 = $.base64Encode(username + ":" + password); + console.log("base64: " + base64); + xhr.setRequestHeader("Authorization", "Basic " + base64); + }, success: function(data, textStatus, jqXHR) { console.log(data); var formHtml = $(templateSelector).render(data); @@ -278,13 +283,21 @@ $(document).ready(function() { }); } + var username = "mifos"; + var password = "password"; + $("#tabs").tabs({ "ajaxOptions": { type: 'GET', dataType: 'json', contentType: 'application/json', cache: false, - error: function( xhr, status, index, anchor) { + beforeSend: function(xhr) { + var base64 = $.base64Encode(username + ":" + password); + console.log("base64: " + base64); + xhr.setRequestHeader("Authorization", "Basic " + base64); + }, + error: function(xhr, status, index, anchor) { $(anchor.hash).html("error occured while ajax loading."); }, success: function(data, status, xhr) { diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/oauth-navigation.jsp b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/oauth-navigation.jsp deleted file mode 100644 index dfb90b521..000000000 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/oauth-navigation.jsp +++ /dev/null @@ -1,15 +0,0 @@ -<%@ page trimDirectiveWhitespaces="true" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> -<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %> - - - - - - -

diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/oauth_error.jsp b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/oauth_error.jsp deleted file mode 100644 index 122ec084d..000000000 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/oauth_error.jsp +++ /dev/null @@ -1,55 +0,0 @@ -<%@ page session="true" %> -<%@ page trimDirectiveWhitespaces="true" %> -<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> -<%@ page import="java.io.PrintWriter" %> -<%@ page import="java.io.StringWriter" %> -<%@ page import="org.springframework.security.oauth.consumer.filter.OAuthConsumerContextFilter" %> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> - - - - - - - - -
- - - -
- -

OAuth Error

- -
-
- - It appears that the OAuth mechanism failed: -
<%= ((Exception) session.getAttribute(OAuthConsumerContextFilter.OAUTH_FAILURE_KEY)).getMessage() %>
-
-
- -
- -

You may need to update the OAuth consumer details this application uses here.

-
- - <% - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - - ((Exception) session.getAttribute(OAuthConsumerContextFilter.OAUTH_FAILURE_KEY)).printStackTrace(pw); - out.print(sw); - sw.close(); - pw.close(); - %> - -
- -
-
- - \ No newline at end of file diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/top-navigation.jsp b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/top-navigation.jsp index 8aa70a837..be45967ab 100644 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/top-navigation.jsp +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/views/top-navigation.jsp @@ -51,7 +51,7 @@
  • - +
  • diff --git a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/web.xml b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/web.xml index cbd96c6c2..83e24b4ff 100644 --- a/mifosng-individual-lending-app/src/main/webapp/WEB-INF/web.xml +++ b/mifosng-individual-lending-app/src/main/webapp/WEB-INF/web.xml @@ -17,7 +17,6 @@ classpath*:META-INF/spring/appContext.xml - + org.springframework.web.context.ContextLoaderListener diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/api/AuthenticationApiResource.java b/mifosng-provider/src/main/java/org/mifosng/platform/api/AuthenticationApiResource.java new file mode 100644 index 000000000..553644ba1 --- /dev/null +++ b/mifosng-provider/src/main/java/org/mifosng/platform/api/AuthenticationApiResource.java @@ -0,0 +1,56 @@ +package org.mifosng.platform.api; + +import java.util.ArrayList; +import java.util.Collection; + +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +import org.mifosng.data.AuthenticatedUserData; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.context.annotation.Scope; +import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; +import org.springframework.security.authentication.dao.DaoAuthenticationProvider; +import org.springframework.security.core.Authentication; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.stereotype.Component; + +@Path("/v1/authentication") +@Component +@Scope("singleton") +public class AuthenticationApiResource { + + @Qualifier("customAuthenticationProvider") + @Autowired + private DaoAuthenticationProvider customAuthenticationProvider; + + @POST + @Consumes({MediaType.APPLICATION_XML}) + @Produces({MediaType.APPLICATION_XML}) + public Response authenticate(@QueryParam("username") final String username, @QueryParam("password") final String password) { + + Authentication authentication = new UsernamePasswordAuthenticationToken(username, password); + Authentication authenticationCheck = customAuthenticationProvider.authenticate(authentication); + + Collection permissions = new ArrayList(); + AuthenticatedUserData authenticatedUserData = new AuthenticatedUserData(permissions); + authenticatedUserData.setUsername(username); + + if (authenticationCheck.isAuthenticated()) { + Collection authorities = new ArrayList(authenticationCheck.getAuthorities()); + for (GrantedAuthority grantedAuthority : authorities) { + permissions.add(grantedAuthority.getAuthority()); + } + authenticatedUserData.setPermissions(permissions); + authenticatedUserData.setAuthenticated(true); + } + + return Response.ok().entity(authenticatedUserData).build(); + } +} \ No newline at end of file diff --git a/mifosng-provider/src/main/java/org/mifosng/platform/security/PlatformSecurityContextThroughSpringSecurity.java b/mifosng-provider/src/main/java/org/mifosng/platform/security/SpringSecurityPlatformSecurityContext.java similarity index 90% rename from mifosng-provider/src/main/java/org/mifosng/platform/security/PlatformSecurityContextThroughSpringSecurity.java rename to mifosng-provider/src/main/java/org/mifosng/platform/security/SpringSecurityPlatformSecurityContext.java index bf43d80e4..709c17786 100644 --- a/mifosng-provider/src/main/java/org/mifosng/platform/security/PlatformSecurityContextThroughSpringSecurity.java +++ b/mifosng-provider/src/main/java/org/mifosng/platform/security/SpringSecurityPlatformSecurityContext.java @@ -11,7 +11,7 @@ import org.springframework.stereotype.Service; * Responsible for returning the current authenticated user that is currently set in the {@link SecurityContext}. */ @Service -public class PlatformSecurityContextThroughSpringSecurity implements PlatformSecurityContext { +public class SpringSecurityPlatformSecurityContext implements PlatformSecurityContext { @Override public AppUser authenticatedUser() { diff --git a/mifosng-provider/src/main/resources/META-INF/spring/securityContext.xml b/mifosng-provider/src/main/resources/META-INF/spring/securityContext.xml index 52ee7fd02..43f4cfaf1 100644 --- a/mifosng-provider/src/main/resources/META-INF/spring/securityContext.xml +++ b/mifosng-provider/src/main/resources/META-INF/spring/securityContext.xml @@ -1,15 +1,20 @@ + + - + + + + +