类 SimpleEncryptor

java.lang.Object
cn.zhxu.toys.cipher.SimpleEncryptor
所有已实现的接口:
Encryptor
直接已知子类:
SIM2Encryptor

public class SimpleEncryptor extends Object implements Encryptor
简单加密算法
作者:
Administrator
  • 字段详细资料

    • secret

      protected byte[] secret
  • 构造器详细资料

    • SimpleEncryptor

      public SimpleEncryptor()
    • SimpleEncryptor

      public SimpleEncryptor(byte[] secret)
    • SimpleEncryptor

      public SimpleEncryptor(String secret)
  • 方法详细资料

    • init

      public void init(String secret)
      从接口复制的说明: Encryptor
      初始化
      指定者:
      init 在接口中 Encryptor
    • doInit

      protected void doInit(byte[] secret)
    • encrypt

      public byte[] encrypt(byte[] plainBytes)
      从接口复制的说明: Encryptor
      加密
      指定者:
      encrypt 在接口中 Encryptor
      参数:
      plainBytes - 明文
      返回:
    • encrypt

      public byte[] encrypt(byte[] secretBytes, byte[] plainBytes)
      从接口复制的说明: Encryptor
      加密
      指定者:
      encrypt 在接口中 Encryptor
      参数:
      secretBytes - 密钥
      plainBytes - 明文
      返回:
    • encrypt

      public String encrypt(String plainText)
      从接口复制的说明: Encryptor
      加密
      指定者:
      encrypt 在接口中 Encryptor
      返回:
    • encrypt

      public String encrypt(String secretText, String plainText)
      从接口复制的说明: Encryptor
      加密
      指定者:
      encrypt 在接口中 Encryptor
      参数:
      secretText - 密钥
      plainText - 明文
      返回:
    • doEncrypt

      protected byte[] doEncrypt(byte[] secretBytes, byte[] plainBytes)