spring-jekyll-theme 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +49 -0
- data/_includes/disqus.html +17 -0
- data/_includes/disqus_comments.html +20 -0
- data/_includes/footer.html +23 -0
- data/_includes/google-analytics.html +9 -0
- data/_includes/head.html +21 -0
- data/_includes/header.html +31 -0
- data/_includes/profile.html +21 -0
- data/_includes/social.html +19 -0
- data/_layouts/default.html +20 -0
- data/_layouts/home.html +34 -0
- data/_layouts/page.html +14 -0
- data/_layouts/post.html +43 -0
- data/_sass/spring/_base.scss +272 -0
- data/_sass/spring/_layout.scss +290 -0
- data/_sass/spring/_syntax-highlighting.scss +71 -0
- data/_sass/spring.scss +56 -0
- data/assets/3rd-party/crypto-js/CONTRIBUTING.md +28 -0
- data/assets/3rd-party/crypto-js/LICENSE +24 -0
- data/assets/3rd-party/crypto-js/README.md +249 -0
- data/assets/3rd-party/crypto-js/aes.js +234 -0
- data/assets/3rd-party/crypto-js/bower.json +35 -0
- data/assets/3rd-party/crypto-js/cipher-core.js +890 -0
- data/assets/3rd-party/crypto-js/core.js +797 -0
- data/assets/3rd-party/crypto-js/crypto-js.js +6059 -0
- data/assets/3rd-party/crypto-js/docs/QuickStartGuide.wiki +470 -0
- data/assets/3rd-party/crypto-js/enc-base64.js +136 -0
- data/assets/3rd-party/crypto-js/enc-hex.js +18 -0
- data/assets/3rd-party/crypto-js/enc-latin1.js +18 -0
- data/assets/3rd-party/crypto-js/enc-utf16.js +149 -0
- data/assets/3rd-party/crypto-js/enc-utf8.js +18 -0
- data/assets/3rd-party/crypto-js/evpkdf.js +134 -0
- data/assets/3rd-party/crypto-js/format-hex.js +66 -0
- data/assets/3rd-party/crypto-js/format-openssl.js +18 -0
- data/assets/3rd-party/crypto-js/hmac-md5.js +18 -0
- data/assets/3rd-party/crypto-js/hmac-ripemd160.js +18 -0
- data/assets/3rd-party/crypto-js/hmac-sha1.js +18 -0
- data/assets/3rd-party/crypto-js/hmac-sha224.js +18 -0
- data/assets/3rd-party/crypto-js/hmac-sha256.js +18 -0
- data/assets/3rd-party/crypto-js/hmac-sha3.js +18 -0
- data/assets/3rd-party/crypto-js/hmac-sha384.js +18 -0
- data/assets/3rd-party/crypto-js/hmac-sha512.js +18 -0
- data/assets/3rd-party/crypto-js/hmac.js +143 -0
- data/assets/3rd-party/crypto-js/index.js +18 -0
- data/assets/3rd-party/crypto-js/lib-typedarrays.js +76 -0
- data/assets/3rd-party/crypto-js/md5.js +268 -0
- data/assets/3rd-party/crypto-js/mode-cfb.js +80 -0
- data/assets/3rd-party/crypto-js/mode-ctr-gladman.js +116 -0
- data/assets/3rd-party/crypto-js/mode-ctr.js +58 -0
- data/assets/3rd-party/crypto-js/mode-ecb.js +40 -0
- data/assets/3rd-party/crypto-js/mode-ofb.js +54 -0
- data/assets/3rd-party/crypto-js/package.json +66 -0
- data/assets/3rd-party/crypto-js/pad-ansix923.js +49 -0
- data/assets/3rd-party/crypto-js/pad-iso10126.js +44 -0
- data/assets/3rd-party/crypto-js/pad-iso97971.js +40 -0
- data/assets/3rd-party/crypto-js/pad-nopadding.js +30 -0
- data/assets/3rd-party/crypto-js/pad-pkcs7.js +18 -0
- data/assets/3rd-party/crypto-js/pad-zeropadding.js +47 -0
- data/assets/3rd-party/crypto-js/pbkdf2.js +145 -0
- data/assets/3rd-party/crypto-js/rabbit-legacy.js +190 -0
- data/assets/3rd-party/crypto-js/rabbit.js +192 -0
- data/assets/3rd-party/crypto-js/rc4.js +139 -0
- data/assets/3rd-party/crypto-js/ripemd160.js +267 -0
- data/assets/3rd-party/crypto-js/sha1.js +150 -0
- data/assets/3rd-party/crypto-js/sha224.js +80 -0
- data/assets/3rd-party/crypto-js/sha256.js +199 -0
- data/assets/3rd-party/crypto-js/sha3.js +326 -0
- data/assets/3rd-party/crypto-js/sha384.js +83 -0
- data/assets/3rd-party/crypto-js/sha512.js +326 -0
- data/assets/3rd-party/crypto-js/tripledes.js +779 -0
- data/assets/3rd-party/crypto-js/x64-core.js +304 -0
- data/assets/css/style.scss +5 -0
- data/assets/ecmascripts/index.js +25 -0
- data/assets/images/avatar.png +0 -0
- data/assets/images/background.jpg +0 -0
- data/assets/social-icons.svg +28 -0
- metadata +176 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
;(function (root, factory, undef) {
|
2
|
+
if (typeof exports === "object") {
|
3
|
+
// CommonJS
|
4
|
+
module.exports = exports = factory(require("./core"), require("./x64-core"), require("./lib-typedarrays"), require("./enc-utf16"), require("./enc-base64"), require("./md5"), require("./sha1"), require("./sha256"), require("./sha224"), require("./sha512"), require("./sha384"), require("./sha3"), require("./ripemd160"), require("./hmac"), require("./pbkdf2"), require("./evpkdf"), require("./cipher-core"), require("./mode-cfb"), require("./mode-ctr"), require("./mode-ctr-gladman"), require("./mode-ofb"), require("./mode-ecb"), require("./pad-ansix923"), require("./pad-iso10126"), require("./pad-iso97971"), require("./pad-zeropadding"), require("./pad-nopadding"), require("./format-hex"), require("./aes"), require("./tripledes"), require("./rc4"), require("./rabbit"), require("./rabbit-legacy"));
|
5
|
+
}
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
7
|
+
// AMD
|
8
|
+
define(["./core", "./x64-core", "./lib-typedarrays", "./enc-utf16", "./enc-base64", "./md5", "./sha1", "./sha256", "./sha224", "./sha512", "./sha384", "./sha3", "./ripemd160", "./hmac", "./pbkdf2", "./evpkdf", "./cipher-core", "./mode-cfb", "./mode-ctr", "./mode-ctr-gladman", "./mode-ofb", "./mode-ecb", "./pad-ansix923", "./pad-iso10126", "./pad-iso97971", "./pad-zeropadding", "./pad-nopadding", "./format-hex", "./aes", "./tripledes", "./rc4", "./rabbit", "./rabbit-legacy"], factory);
|
9
|
+
}
|
10
|
+
else {
|
11
|
+
// Global (browser)
|
12
|
+
root.CryptoJS = factory(root.CryptoJS);
|
13
|
+
}
|
14
|
+
}(this, function (CryptoJS) {
|
15
|
+
|
16
|
+
return CryptoJS;
|
17
|
+
|
18
|
+
}));
|
@@ -0,0 +1,76 @@
|
|
1
|
+
;(function (root, factory) {
|
2
|
+
if (typeof exports === "object") {
|
3
|
+
// CommonJS
|
4
|
+
module.exports = exports = factory(require("./core"));
|
5
|
+
}
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
7
|
+
// AMD
|
8
|
+
define(["./core"], factory);
|
9
|
+
}
|
10
|
+
else {
|
11
|
+
// Global (browser)
|
12
|
+
factory(root.CryptoJS);
|
13
|
+
}
|
14
|
+
}(this, function (CryptoJS) {
|
15
|
+
|
16
|
+
(function () {
|
17
|
+
// Check if typed arrays are supported
|
18
|
+
if (typeof ArrayBuffer != 'function') {
|
19
|
+
return;
|
20
|
+
}
|
21
|
+
|
22
|
+
// Shortcuts
|
23
|
+
var C = CryptoJS;
|
24
|
+
var C_lib = C.lib;
|
25
|
+
var WordArray = C_lib.WordArray;
|
26
|
+
|
27
|
+
// Reference original init
|
28
|
+
var superInit = WordArray.init;
|
29
|
+
|
30
|
+
// Augment WordArray.init to handle typed arrays
|
31
|
+
var subInit = WordArray.init = function (typedArray) {
|
32
|
+
// Convert buffers to uint8
|
33
|
+
if (typedArray instanceof ArrayBuffer) {
|
34
|
+
typedArray = new Uint8Array(typedArray);
|
35
|
+
}
|
36
|
+
|
37
|
+
// Convert other array views to uint8
|
38
|
+
if (
|
39
|
+
typedArray instanceof Int8Array ||
|
40
|
+
(typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray) ||
|
41
|
+
typedArray instanceof Int16Array ||
|
42
|
+
typedArray instanceof Uint16Array ||
|
43
|
+
typedArray instanceof Int32Array ||
|
44
|
+
typedArray instanceof Uint32Array ||
|
45
|
+
typedArray instanceof Float32Array ||
|
46
|
+
typedArray instanceof Float64Array
|
47
|
+
) {
|
48
|
+
typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
|
49
|
+
}
|
50
|
+
|
51
|
+
// Handle Uint8Array
|
52
|
+
if (typedArray instanceof Uint8Array) {
|
53
|
+
// Shortcut
|
54
|
+
var typedArrayByteLength = typedArray.byteLength;
|
55
|
+
|
56
|
+
// Extract bytes
|
57
|
+
var words = [];
|
58
|
+
for (var i = 0; i < typedArrayByteLength; i++) {
|
59
|
+
words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);
|
60
|
+
}
|
61
|
+
|
62
|
+
// Initialize this word array
|
63
|
+
superInit.call(this, words, typedArrayByteLength);
|
64
|
+
} else {
|
65
|
+
// Else call normal init
|
66
|
+
superInit.apply(this, arguments);
|
67
|
+
}
|
68
|
+
};
|
69
|
+
|
70
|
+
subInit.prototype = WordArray;
|
71
|
+
}());
|
72
|
+
|
73
|
+
|
74
|
+
return CryptoJS.lib.WordArray;
|
75
|
+
|
76
|
+
}));
|
@@ -0,0 +1,268 @@
|
|
1
|
+
;(function (root, factory) {
|
2
|
+
if (typeof exports === "object") {
|
3
|
+
// CommonJS
|
4
|
+
module.exports = exports = factory(require("./core"));
|
5
|
+
}
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
7
|
+
// AMD
|
8
|
+
define(["./core"], factory);
|
9
|
+
}
|
10
|
+
else {
|
11
|
+
// Global (browser)
|
12
|
+
factory(root.CryptoJS);
|
13
|
+
}
|
14
|
+
}(this, function (CryptoJS) {
|
15
|
+
|
16
|
+
(function (Math) {
|
17
|
+
// Shortcuts
|
18
|
+
var C = CryptoJS;
|
19
|
+
var C_lib = C.lib;
|
20
|
+
var WordArray = C_lib.WordArray;
|
21
|
+
var Hasher = C_lib.Hasher;
|
22
|
+
var C_algo = C.algo;
|
23
|
+
|
24
|
+
// Constants table
|
25
|
+
var T = [];
|
26
|
+
|
27
|
+
// Compute constants
|
28
|
+
(function () {
|
29
|
+
for (var i = 0; i < 64; i++) {
|
30
|
+
T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;
|
31
|
+
}
|
32
|
+
}());
|
33
|
+
|
34
|
+
/**
|
35
|
+
* MD5 hash algorithm.
|
36
|
+
*/
|
37
|
+
var MD5 = C_algo.MD5 = Hasher.extend({
|
38
|
+
_doReset: function () {
|
39
|
+
this._hash = new WordArray.init([
|
40
|
+
0x67452301, 0xefcdab89,
|
41
|
+
0x98badcfe, 0x10325476
|
42
|
+
]);
|
43
|
+
},
|
44
|
+
|
45
|
+
_doProcessBlock: function (M, offset) {
|
46
|
+
// Swap endian
|
47
|
+
for (var i = 0; i < 16; i++) {
|
48
|
+
// Shortcuts
|
49
|
+
var offset_i = offset + i;
|
50
|
+
var M_offset_i = M[offset_i];
|
51
|
+
|
52
|
+
M[offset_i] = (
|
53
|
+
(((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
|
54
|
+
(((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
|
55
|
+
);
|
56
|
+
}
|
57
|
+
|
58
|
+
// Shortcuts
|
59
|
+
var H = this._hash.words;
|
60
|
+
|
61
|
+
var M_offset_0 = M[offset + 0];
|
62
|
+
var M_offset_1 = M[offset + 1];
|
63
|
+
var M_offset_2 = M[offset + 2];
|
64
|
+
var M_offset_3 = M[offset + 3];
|
65
|
+
var M_offset_4 = M[offset + 4];
|
66
|
+
var M_offset_5 = M[offset + 5];
|
67
|
+
var M_offset_6 = M[offset + 6];
|
68
|
+
var M_offset_7 = M[offset + 7];
|
69
|
+
var M_offset_8 = M[offset + 8];
|
70
|
+
var M_offset_9 = M[offset + 9];
|
71
|
+
var M_offset_10 = M[offset + 10];
|
72
|
+
var M_offset_11 = M[offset + 11];
|
73
|
+
var M_offset_12 = M[offset + 12];
|
74
|
+
var M_offset_13 = M[offset + 13];
|
75
|
+
var M_offset_14 = M[offset + 14];
|
76
|
+
var M_offset_15 = M[offset + 15];
|
77
|
+
|
78
|
+
// Working varialbes
|
79
|
+
var a = H[0];
|
80
|
+
var b = H[1];
|
81
|
+
var c = H[2];
|
82
|
+
var d = H[3];
|
83
|
+
|
84
|
+
// Computation
|
85
|
+
a = FF(a, b, c, d, M_offset_0, 7, T[0]);
|
86
|
+
d = FF(d, a, b, c, M_offset_1, 12, T[1]);
|
87
|
+
c = FF(c, d, a, b, M_offset_2, 17, T[2]);
|
88
|
+
b = FF(b, c, d, a, M_offset_3, 22, T[3]);
|
89
|
+
a = FF(a, b, c, d, M_offset_4, 7, T[4]);
|
90
|
+
d = FF(d, a, b, c, M_offset_5, 12, T[5]);
|
91
|
+
c = FF(c, d, a, b, M_offset_6, 17, T[6]);
|
92
|
+
b = FF(b, c, d, a, M_offset_7, 22, T[7]);
|
93
|
+
a = FF(a, b, c, d, M_offset_8, 7, T[8]);
|
94
|
+
d = FF(d, a, b, c, M_offset_9, 12, T[9]);
|
95
|
+
c = FF(c, d, a, b, M_offset_10, 17, T[10]);
|
96
|
+
b = FF(b, c, d, a, M_offset_11, 22, T[11]);
|
97
|
+
a = FF(a, b, c, d, M_offset_12, 7, T[12]);
|
98
|
+
d = FF(d, a, b, c, M_offset_13, 12, T[13]);
|
99
|
+
c = FF(c, d, a, b, M_offset_14, 17, T[14]);
|
100
|
+
b = FF(b, c, d, a, M_offset_15, 22, T[15]);
|
101
|
+
|
102
|
+
a = GG(a, b, c, d, M_offset_1, 5, T[16]);
|
103
|
+
d = GG(d, a, b, c, M_offset_6, 9, T[17]);
|
104
|
+
c = GG(c, d, a, b, M_offset_11, 14, T[18]);
|
105
|
+
b = GG(b, c, d, a, M_offset_0, 20, T[19]);
|
106
|
+
a = GG(a, b, c, d, M_offset_5, 5, T[20]);
|
107
|
+
d = GG(d, a, b, c, M_offset_10, 9, T[21]);
|
108
|
+
c = GG(c, d, a, b, M_offset_15, 14, T[22]);
|
109
|
+
b = GG(b, c, d, a, M_offset_4, 20, T[23]);
|
110
|
+
a = GG(a, b, c, d, M_offset_9, 5, T[24]);
|
111
|
+
d = GG(d, a, b, c, M_offset_14, 9, T[25]);
|
112
|
+
c = GG(c, d, a, b, M_offset_3, 14, T[26]);
|
113
|
+
b = GG(b, c, d, a, M_offset_8, 20, T[27]);
|
114
|
+
a = GG(a, b, c, d, M_offset_13, 5, T[28]);
|
115
|
+
d = GG(d, a, b, c, M_offset_2, 9, T[29]);
|
116
|
+
c = GG(c, d, a, b, M_offset_7, 14, T[30]);
|
117
|
+
b = GG(b, c, d, a, M_offset_12, 20, T[31]);
|
118
|
+
|
119
|
+
a = HH(a, b, c, d, M_offset_5, 4, T[32]);
|
120
|
+
d = HH(d, a, b, c, M_offset_8, 11, T[33]);
|
121
|
+
c = HH(c, d, a, b, M_offset_11, 16, T[34]);
|
122
|
+
b = HH(b, c, d, a, M_offset_14, 23, T[35]);
|
123
|
+
a = HH(a, b, c, d, M_offset_1, 4, T[36]);
|
124
|
+
d = HH(d, a, b, c, M_offset_4, 11, T[37]);
|
125
|
+
c = HH(c, d, a, b, M_offset_7, 16, T[38]);
|
126
|
+
b = HH(b, c, d, a, M_offset_10, 23, T[39]);
|
127
|
+
a = HH(a, b, c, d, M_offset_13, 4, T[40]);
|
128
|
+
d = HH(d, a, b, c, M_offset_0, 11, T[41]);
|
129
|
+
c = HH(c, d, a, b, M_offset_3, 16, T[42]);
|
130
|
+
b = HH(b, c, d, a, M_offset_6, 23, T[43]);
|
131
|
+
a = HH(a, b, c, d, M_offset_9, 4, T[44]);
|
132
|
+
d = HH(d, a, b, c, M_offset_12, 11, T[45]);
|
133
|
+
c = HH(c, d, a, b, M_offset_15, 16, T[46]);
|
134
|
+
b = HH(b, c, d, a, M_offset_2, 23, T[47]);
|
135
|
+
|
136
|
+
a = II(a, b, c, d, M_offset_0, 6, T[48]);
|
137
|
+
d = II(d, a, b, c, M_offset_7, 10, T[49]);
|
138
|
+
c = II(c, d, a, b, M_offset_14, 15, T[50]);
|
139
|
+
b = II(b, c, d, a, M_offset_5, 21, T[51]);
|
140
|
+
a = II(a, b, c, d, M_offset_12, 6, T[52]);
|
141
|
+
d = II(d, a, b, c, M_offset_3, 10, T[53]);
|
142
|
+
c = II(c, d, a, b, M_offset_10, 15, T[54]);
|
143
|
+
b = II(b, c, d, a, M_offset_1, 21, T[55]);
|
144
|
+
a = II(a, b, c, d, M_offset_8, 6, T[56]);
|
145
|
+
d = II(d, a, b, c, M_offset_15, 10, T[57]);
|
146
|
+
c = II(c, d, a, b, M_offset_6, 15, T[58]);
|
147
|
+
b = II(b, c, d, a, M_offset_13, 21, T[59]);
|
148
|
+
a = II(a, b, c, d, M_offset_4, 6, T[60]);
|
149
|
+
d = II(d, a, b, c, M_offset_11, 10, T[61]);
|
150
|
+
c = II(c, d, a, b, M_offset_2, 15, T[62]);
|
151
|
+
b = II(b, c, d, a, M_offset_9, 21, T[63]);
|
152
|
+
|
153
|
+
// Intermediate hash value
|
154
|
+
H[0] = (H[0] + a) | 0;
|
155
|
+
H[1] = (H[1] + b) | 0;
|
156
|
+
H[2] = (H[2] + c) | 0;
|
157
|
+
H[3] = (H[3] + d) | 0;
|
158
|
+
},
|
159
|
+
|
160
|
+
_doFinalize: function () {
|
161
|
+
// Shortcuts
|
162
|
+
var data = this._data;
|
163
|
+
var dataWords = data.words;
|
164
|
+
|
165
|
+
var nBitsTotal = this._nDataBytes * 8;
|
166
|
+
var nBitsLeft = data.sigBytes * 8;
|
167
|
+
|
168
|
+
// Add padding
|
169
|
+
dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
|
170
|
+
|
171
|
+
var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);
|
172
|
+
var nBitsTotalL = nBitsTotal;
|
173
|
+
dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (
|
174
|
+
(((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) |
|
175
|
+
(((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00)
|
176
|
+
);
|
177
|
+
dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
|
178
|
+
(((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) |
|
179
|
+
(((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00)
|
180
|
+
);
|
181
|
+
|
182
|
+
data.sigBytes = (dataWords.length + 1) * 4;
|
183
|
+
|
184
|
+
// Hash final blocks
|
185
|
+
this._process();
|
186
|
+
|
187
|
+
// Shortcuts
|
188
|
+
var hash = this._hash;
|
189
|
+
var H = hash.words;
|
190
|
+
|
191
|
+
// Swap endian
|
192
|
+
for (var i = 0; i < 4; i++) {
|
193
|
+
// Shortcut
|
194
|
+
var H_i = H[i];
|
195
|
+
|
196
|
+
H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
|
197
|
+
(((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
|
198
|
+
}
|
199
|
+
|
200
|
+
// Return final computed hash
|
201
|
+
return hash;
|
202
|
+
},
|
203
|
+
|
204
|
+
clone: function () {
|
205
|
+
var clone = Hasher.clone.call(this);
|
206
|
+
clone._hash = this._hash.clone();
|
207
|
+
|
208
|
+
return clone;
|
209
|
+
}
|
210
|
+
});
|
211
|
+
|
212
|
+
function FF(a, b, c, d, x, s, t) {
|
213
|
+
var n = a + ((b & c) | (~b & d)) + x + t;
|
214
|
+
return ((n << s) | (n >>> (32 - s))) + b;
|
215
|
+
}
|
216
|
+
|
217
|
+
function GG(a, b, c, d, x, s, t) {
|
218
|
+
var n = a + ((b & d) | (c & ~d)) + x + t;
|
219
|
+
return ((n << s) | (n >>> (32 - s))) + b;
|
220
|
+
}
|
221
|
+
|
222
|
+
function HH(a, b, c, d, x, s, t) {
|
223
|
+
var n = a + (b ^ c ^ d) + x + t;
|
224
|
+
return ((n << s) | (n >>> (32 - s))) + b;
|
225
|
+
}
|
226
|
+
|
227
|
+
function II(a, b, c, d, x, s, t) {
|
228
|
+
var n = a + (c ^ (b | ~d)) + x + t;
|
229
|
+
return ((n << s) | (n >>> (32 - s))) + b;
|
230
|
+
}
|
231
|
+
|
232
|
+
/**
|
233
|
+
* Shortcut function to the hasher's object interface.
|
234
|
+
*
|
235
|
+
* @param {WordArray|string} message The message to hash.
|
236
|
+
*
|
237
|
+
* @return {WordArray} The hash.
|
238
|
+
*
|
239
|
+
* @static
|
240
|
+
*
|
241
|
+
* @example
|
242
|
+
*
|
243
|
+
* var hash = CryptoJS.MD5('message');
|
244
|
+
* var hash = CryptoJS.MD5(wordArray);
|
245
|
+
*/
|
246
|
+
C.MD5 = Hasher._createHelper(MD5);
|
247
|
+
|
248
|
+
/**
|
249
|
+
* Shortcut function to the HMAC's object interface.
|
250
|
+
*
|
251
|
+
* @param {WordArray|string} message The message to hash.
|
252
|
+
* @param {WordArray|string} key The secret key.
|
253
|
+
*
|
254
|
+
* @return {WordArray} The HMAC.
|
255
|
+
*
|
256
|
+
* @static
|
257
|
+
*
|
258
|
+
* @example
|
259
|
+
*
|
260
|
+
* var hmac = CryptoJS.HmacMD5(message, key);
|
261
|
+
*/
|
262
|
+
C.HmacMD5 = Hasher._createHmacHelper(MD5);
|
263
|
+
}(Math));
|
264
|
+
|
265
|
+
|
266
|
+
return CryptoJS.MD5;
|
267
|
+
|
268
|
+
}));
|
@@ -0,0 +1,80 @@
|
|
1
|
+
;(function (root, factory, undef) {
|
2
|
+
if (typeof exports === "object") {
|
3
|
+
// CommonJS
|
4
|
+
module.exports = exports = factory(require("./core"), require("./cipher-core"));
|
5
|
+
}
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
7
|
+
// AMD
|
8
|
+
define(["./core", "./cipher-core"], factory);
|
9
|
+
}
|
10
|
+
else {
|
11
|
+
// Global (browser)
|
12
|
+
factory(root.CryptoJS);
|
13
|
+
}
|
14
|
+
}(this, function (CryptoJS) {
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Cipher Feedback block mode.
|
18
|
+
*/
|
19
|
+
CryptoJS.mode.CFB = (function () {
|
20
|
+
var CFB = CryptoJS.lib.BlockCipherMode.extend();
|
21
|
+
|
22
|
+
CFB.Encryptor = CFB.extend({
|
23
|
+
processBlock: function (words, offset) {
|
24
|
+
// Shortcuts
|
25
|
+
var cipher = this._cipher;
|
26
|
+
var blockSize = cipher.blockSize;
|
27
|
+
|
28
|
+
generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
|
29
|
+
|
30
|
+
// Remember this block to use with next block
|
31
|
+
this._prevBlock = words.slice(offset, offset + blockSize);
|
32
|
+
}
|
33
|
+
});
|
34
|
+
|
35
|
+
CFB.Decryptor = CFB.extend({
|
36
|
+
processBlock: function (words, offset) {
|
37
|
+
// Shortcuts
|
38
|
+
var cipher = this._cipher;
|
39
|
+
var blockSize = cipher.blockSize;
|
40
|
+
|
41
|
+
// Remember this block to use with next block
|
42
|
+
var thisBlock = words.slice(offset, offset + blockSize);
|
43
|
+
|
44
|
+
generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
|
45
|
+
|
46
|
+
// This block becomes the previous block
|
47
|
+
this._prevBlock = thisBlock;
|
48
|
+
}
|
49
|
+
});
|
50
|
+
|
51
|
+
function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
|
52
|
+
var keystream;
|
53
|
+
|
54
|
+
// Shortcut
|
55
|
+
var iv = this._iv;
|
56
|
+
|
57
|
+
// Generate keystream
|
58
|
+
if (iv) {
|
59
|
+
keystream = iv.slice(0);
|
60
|
+
|
61
|
+
// Remove IV for subsequent blocks
|
62
|
+
this._iv = undefined;
|
63
|
+
} else {
|
64
|
+
keystream = this._prevBlock;
|
65
|
+
}
|
66
|
+
cipher.encryptBlock(keystream, 0);
|
67
|
+
|
68
|
+
// Encrypt
|
69
|
+
for (var i = 0; i < blockSize; i++) {
|
70
|
+
words[offset + i] ^= keystream[i];
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
return CFB;
|
75
|
+
}());
|
76
|
+
|
77
|
+
|
78
|
+
return CryptoJS.mode.CFB;
|
79
|
+
|
80
|
+
}));
|
@@ -0,0 +1,116 @@
|
|
1
|
+
;(function (root, factory, undef) {
|
2
|
+
if (typeof exports === "object") {
|
3
|
+
// CommonJS
|
4
|
+
module.exports = exports = factory(require("./core"), require("./cipher-core"));
|
5
|
+
}
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
7
|
+
// AMD
|
8
|
+
define(["./core", "./cipher-core"], factory);
|
9
|
+
}
|
10
|
+
else {
|
11
|
+
// Global (browser)
|
12
|
+
factory(root.CryptoJS);
|
13
|
+
}
|
14
|
+
}(this, function (CryptoJS) {
|
15
|
+
|
16
|
+
/** @preserve
|
17
|
+
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
18
|
+
* derived from CryptoJS.mode.CTR
|
19
|
+
* Jan Hruby jhruby.web@gmail.com
|
20
|
+
*/
|
21
|
+
CryptoJS.mode.CTRGladman = (function () {
|
22
|
+
var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();
|
23
|
+
|
24
|
+
function incWord(word)
|
25
|
+
{
|
26
|
+
if (((word >> 24) & 0xff) === 0xff) { //overflow
|
27
|
+
var b1 = (word >> 16)&0xff;
|
28
|
+
var b2 = (word >> 8)&0xff;
|
29
|
+
var b3 = word & 0xff;
|
30
|
+
|
31
|
+
if (b1 === 0xff) // overflow b1
|
32
|
+
{
|
33
|
+
b1 = 0;
|
34
|
+
if (b2 === 0xff)
|
35
|
+
{
|
36
|
+
b2 = 0;
|
37
|
+
if (b3 === 0xff)
|
38
|
+
{
|
39
|
+
b3 = 0;
|
40
|
+
}
|
41
|
+
else
|
42
|
+
{
|
43
|
+
++b3;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
else
|
47
|
+
{
|
48
|
+
++b2;
|
49
|
+
}
|
50
|
+
}
|
51
|
+
else
|
52
|
+
{
|
53
|
+
++b1;
|
54
|
+
}
|
55
|
+
|
56
|
+
word = 0;
|
57
|
+
word += (b1 << 16);
|
58
|
+
word += (b2 << 8);
|
59
|
+
word += b3;
|
60
|
+
}
|
61
|
+
else
|
62
|
+
{
|
63
|
+
word += (0x01 << 24);
|
64
|
+
}
|
65
|
+
return word;
|
66
|
+
}
|
67
|
+
|
68
|
+
function incCounter(counter)
|
69
|
+
{
|
70
|
+
if ((counter[0] = incWord(counter[0])) === 0)
|
71
|
+
{
|
72
|
+
// encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8
|
73
|
+
counter[1] = incWord(counter[1]);
|
74
|
+
}
|
75
|
+
return counter;
|
76
|
+
}
|
77
|
+
|
78
|
+
var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({
|
79
|
+
processBlock: function (words, offset) {
|
80
|
+
// Shortcuts
|
81
|
+
var cipher = this._cipher
|
82
|
+
var blockSize = cipher.blockSize;
|
83
|
+
var iv = this._iv;
|
84
|
+
var counter = this._counter;
|
85
|
+
|
86
|
+
// Generate keystream
|
87
|
+
if (iv) {
|
88
|
+
counter = this._counter = iv.slice(0);
|
89
|
+
|
90
|
+
// Remove IV for subsequent blocks
|
91
|
+
this._iv = undefined;
|
92
|
+
}
|
93
|
+
|
94
|
+
incCounter(counter);
|
95
|
+
|
96
|
+
var keystream = counter.slice(0);
|
97
|
+
cipher.encryptBlock(keystream, 0);
|
98
|
+
|
99
|
+
// Encrypt
|
100
|
+
for (var i = 0; i < blockSize; i++) {
|
101
|
+
words[offset + i] ^= keystream[i];
|
102
|
+
}
|
103
|
+
}
|
104
|
+
});
|
105
|
+
|
106
|
+
CTRGladman.Decryptor = Encryptor;
|
107
|
+
|
108
|
+
return CTRGladman;
|
109
|
+
}());
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
return CryptoJS.mode.CTRGladman;
|
115
|
+
|
116
|
+
}));
|
@@ -0,0 +1,58 @@
|
|
1
|
+
;(function (root, factory, undef) {
|
2
|
+
if (typeof exports === "object") {
|
3
|
+
// CommonJS
|
4
|
+
module.exports = exports = factory(require("./core"), require("./cipher-core"));
|
5
|
+
}
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
7
|
+
// AMD
|
8
|
+
define(["./core", "./cipher-core"], factory);
|
9
|
+
}
|
10
|
+
else {
|
11
|
+
// Global (browser)
|
12
|
+
factory(root.CryptoJS);
|
13
|
+
}
|
14
|
+
}(this, function (CryptoJS) {
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Counter block mode.
|
18
|
+
*/
|
19
|
+
CryptoJS.mode.CTR = (function () {
|
20
|
+
var CTR = CryptoJS.lib.BlockCipherMode.extend();
|
21
|
+
|
22
|
+
var Encryptor = CTR.Encryptor = CTR.extend({
|
23
|
+
processBlock: function (words, offset) {
|
24
|
+
// Shortcuts
|
25
|
+
var cipher = this._cipher
|
26
|
+
var blockSize = cipher.blockSize;
|
27
|
+
var iv = this._iv;
|
28
|
+
var counter = this._counter;
|
29
|
+
|
30
|
+
// Generate keystream
|
31
|
+
if (iv) {
|
32
|
+
counter = this._counter = iv.slice(0);
|
33
|
+
|
34
|
+
// Remove IV for subsequent blocks
|
35
|
+
this._iv = undefined;
|
36
|
+
}
|
37
|
+
var keystream = counter.slice(0);
|
38
|
+
cipher.encryptBlock(keystream, 0);
|
39
|
+
|
40
|
+
// Increment counter
|
41
|
+
counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0
|
42
|
+
|
43
|
+
// Encrypt
|
44
|
+
for (var i = 0; i < blockSize; i++) {
|
45
|
+
words[offset + i] ^= keystream[i];
|
46
|
+
}
|
47
|
+
}
|
48
|
+
});
|
49
|
+
|
50
|
+
CTR.Decryptor = Encryptor;
|
51
|
+
|
52
|
+
return CTR;
|
53
|
+
}());
|
54
|
+
|
55
|
+
|
56
|
+
return CryptoJS.mode.CTR;
|
57
|
+
|
58
|
+
}));
|
@@ -0,0 +1,40 @@
|
|
1
|
+
;(function (root, factory, undef) {
|
2
|
+
if (typeof exports === "object") {
|
3
|
+
// CommonJS
|
4
|
+
module.exports = exports = factory(require("./core"), require("./cipher-core"));
|
5
|
+
}
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
7
|
+
// AMD
|
8
|
+
define(["./core", "./cipher-core"], factory);
|
9
|
+
}
|
10
|
+
else {
|
11
|
+
// Global (browser)
|
12
|
+
factory(root.CryptoJS);
|
13
|
+
}
|
14
|
+
}(this, function (CryptoJS) {
|
15
|
+
|
16
|
+
/**
|
17
|
+
* Electronic Codebook block mode.
|
18
|
+
*/
|
19
|
+
CryptoJS.mode.ECB = (function () {
|
20
|
+
var ECB = CryptoJS.lib.BlockCipherMode.extend();
|
21
|
+
|
22
|
+
ECB.Encryptor = ECB.extend({
|
23
|
+
processBlock: function (words, offset) {
|
24
|
+
this._cipher.encryptBlock(words, offset);
|
25
|
+
}
|
26
|
+
});
|
27
|
+
|
28
|
+
ECB.Decryptor = ECB.extend({
|
29
|
+
processBlock: function (words, offset) {
|
30
|
+
this._cipher.decryptBlock(words, offset);
|
31
|
+
}
|
32
|
+
});
|
33
|
+
|
34
|
+
return ECB;
|
35
|
+
}());
|
36
|
+
|
37
|
+
|
38
|
+
return CryptoJS.mode.ECB;
|
39
|
+
|
40
|
+
}));
|