mode-ecb.js 604 B

1234567891011121314151617181920212223242526
  1. /*
  2. CryptoJS v3.1.2
  3. code.google.com/p/crypto-js
  4. (c) 2009-2013 by Jeff Mott. All rights reserved.
  5. code.google.com/p/crypto-js/wiki/License
  6. */
  7. /**
  8. * Electronic Codebook block mode.
  9. */
  10. CryptoJS.mode.ECB = (function () {
  11. var ECB = CryptoJS.lib.BlockCipherMode.extend();
  12. ECB.Encryptor = ECB.extend({
  13. processBlock: function (words, offset) {
  14. this._cipher.encryptBlock(words, offset);
  15. }
  16. });
  17. ECB.Decryptor = ECB.extend({
  18. processBlock: function (words, offset) {
  19. this._cipher.decryptBlock(words, offset);
  20. }
  21. });
  22. return ECB;
  23. }());