PageRenderTime 82ms CodeModel.GetById 13ms RepoModel.GetById 0ms app.codeStats 0ms

/Crypto/Cipher/__init__.py

https://bitbucket.org/djlawler/ironpycrypto
Python | 63 lines | 36 code | 1 blank | 26 comment | 1 complexity | 59bfe8aad98ade981bd84106f32f4c29 MD5 | raw file
  1. # -*- coding: utf-8 -*-
  2. #
  3. # ===================================================================
  4. # The contents of this file are dedicated to the public domain. To
  5. # the extent that dedication to the public domain is not available,
  6. # everyone is granted a worldwide, perpetual, royalty-free,
  7. # non-exclusive license to exercise all rights associated with the
  8. # contents of this file for any purpose whatsoever.
  9. # No rights are reserved.
  10. #
  11. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  12. # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  13. # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  14. # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  15. # BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  16. # ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  17. # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  18. # SOFTWARE.
  19. # ===================================================================
  20. """Secret-key encryption algorithms.
  21. Secret-key encryption algorithms transform plaintext in some way that
  22. is dependent on a key, producing ciphertext. This transformation can
  23. easily be reversed, if (and, hopefully, only if) one knows the key.
  24. The encryption modules here all support the interface described in PEP
  25. 272, "API for Block Encryption Algorithms".
  26. If you don't know which algorithm to choose, use AES because it's
  27. standard and has undergone a fair bit of examination.
  28. Crypto.Cipher.AES Advanced Encryption Standard
  29. Crypto.Cipher.ARC2 Alleged RC2
  30. Crypto.Cipher.ARC4 Alleged RC4
  31. Crypto.Cipher.Blowfish
  32. Crypto.Cipher.CAST
  33. Crypto.Cipher.DES The Data Encryption Standard. Very commonly used
  34. in the past, but today its 56-bit keys are too small.
  35. Crypto.Cipher.DES3 Triple DES.
  36. Crypto.Cipher.XOR The simple XOR cipher.
  37. """
  38. import sys
  39. if sys.platform == "cli":
  40. import clr
  41. clr.AddReference("IronPyCrypto.dll")
  42. import IronPyCrypto_Cipher_AES as AES
  43. import IronPyCrypto_Cipher_ARC2 as ARC2
  44. import IronPyCrypto_Cipher_ARC4 as ARC4
  45. import IronPyCrypto_Cipher_Blowfish as Blowfish
  46. import IronPyCrypto_Cipher_CAST as CAST
  47. import IronPyCrypto_Cipher_DES as DES
  48. import IronPyCrypto_Cipher_DES3 as DES3
  49. import IronPyCrypto_Cipher_XOR as XOR
  50. __all__ = ['AES', 'ARC2', 'ARC4',
  51. 'Blowfish', 'CAST', 'DES', 'DES3',
  52. 'XOR'
  53. ]
  54. __revision__ = "$Id$"