/flash-src/third-party/com/hurlant/crypto/symmetric/ISymmetricKey.as

http://github.com/gimite/web-socket-js · ActionScript · 35 lines · 12 code · 2 blank · 21 comment · 0 complexity · 653acfc614824311e0008caf89d6bb76 MD5 · raw file

  1. /**
  2. * ISymmetricKey
  3. *
  4. * An interface for symmetric encryption keys to implement.
  5. * Copyright (c) 2007 Henri Torgemane
  6. *
  7. * See LICENSE.txt for full license information.
  8. */
  9. package com.hurlant.crypto.symmetric
  10. {
  11. import flash.utils.ByteArray;
  12. public interface ISymmetricKey
  13. {
  14. /**
  15. * Returns the block size used by this particular encryption algorithm
  16. */
  17. function getBlockSize():uint;
  18. /**
  19. * Encrypt one block of data in "block", starting at "index", of length "getBlockSize()"
  20. */
  21. function encrypt(block:ByteArray, index:uint=0):void;
  22. /**
  23. * Decrypt one block of data in "block", starting at "index", of length "getBlockSize()"
  24. */
  25. function decrypt(block:ByteArray, index:uint=0):void;
  26. /**
  27. * Attempts to destroy sensitive information from memory, such as encryption keys.
  28. * Note: This is not guaranteed to work given the Flash sandbox model.
  29. */
  30. function dispose():void;
  31. function toString():String;
  32. }
  33. }