Examples of encrypt()


Examples of com.drighetto.essai.bouncycastle.cipher.SymmetricKeyCipher.encrypt()

      for (i = 0; i < msgToCrypt.length; i++) {
        System.out.print(msgToCrypt[i]);
        System.out.print(";");
      }
      System.out.println("]");
      tempEncrypt = symmetricKeyCipher.encrypt(msgToCrypt);
      System.out.println("Encrypted bytes : ");
      System.out.print("[");
      for (i = 0; i < tempEncrypt.length; i++) {
        System.out.print(tempEncrypt[i]);
        System.out.print(";");
View Full Code Here

Examples of com.encryption.DesEncrypter.encrypt()

      // Create encrypter/decrypter class
      DesEncrypter encrypter = new DesEncrypter(key);
      // Encrypt
      File encryptedFile = new File(uploadFile.getAbsolutePath() + ".des");
      encrypter.encrypt(new FileInputStream(uploadFile),
          new FileOutputStream(encryptedFile));

      /*
       * 利用公钥加密DES密钥
       */
 
View Full Code Here

Examples of com.encryption.RSAEncrypter.encrypt()

      // 从文件中加载公钥
      RSAEncrypter encrypt = new RSAEncrypter();
      String publicKeyPath = "D:/hdfs/" + userId + "/publicKey";
      RSAPublicKey publicKey = (RSAPublicKey) encrypt.loadKey(
          publicKeyPath, 1);
      encryptedDataSecretKey = encrypt.encrypt(publicKey,
          key.getEncoded());
    } catch (Exception e) {
      e.printStackTrace();
    }
    return encryptedDataSecretKey;
View Full Code Here

Examples of com.fathomdb.crypto.CryptoKey.encrypt()

    if (secret == null) {
      throw new IllegalStateException();
    }

    byte[] plaintext = FathomdbCrypto.serialize(userSecret);
    byte[] ciphertext = secret.encrypt(plaintext);

    byte[] header = new byte[1];
    header[0] = tokenId;
    return Bytes.concat(header, ciphertext);
  }
View Full Code Here

Examples of com.googlecode.gwt.crypto.client.AESCipher.encrypt()

    // TODO gwt-crypto doesn't let you set the IV. rewrite?
    public static String encrypt(String key, String iv, String value) {
        AESCipher cipher = new AESCipher();
        cipher.setKey(Hash.hash256(key.getBytes()));
        try {
            return cipher.encrypt(value);
        } catch (InvalidCipherTextException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of com.im.imjutil.cipher.Cipher.encrypt()

  public static String encryptPassword(String password) {
    String pass = password;
    try {
      if (Validator.isValid(pass)) {
        Cipher cipher = Cipher.getInstance();
        byte[] coded = cipher.encrypt(pass.getBytes());
        pass = Base64Coder.encrypt(coded);
      }
    } catch (Exception e) {
      String error = "Erro ao cifrar a senha.";
      Logger.error(error, e);
View Full Code Here

Examples of com.jprotectfile.model.FileEncryptor.encrypt()

        File inputFile = new File(MainView.this.jtfInputFile.getText());
        File outputFile = new File(MainView.this.jtfOutputFile.getText());
        try {
          FileInputStream file1 = new FileInputStream(inputFile);
          FileOutputStream file2 = new FileOutputStream(outputFile);
          enc.encrypt(file1, file2);
        } catch (Exception e) {
          JOptionPane.showMessageDialog(MainView.this, "Erro em criptografar: "+e.getMessage());
        }
        MainView.this.jbEncrypt.setEnabled(true);
        MainView.this.jbDecrypt.setEnabled(true);
View Full Code Here

Examples of com.knowgate.jcifs.util.DES.encrypt()

        byte[] e8 = new byte[8];

        for( int i = 0; i < key.length / 7; i++ ) {
            System.arraycopy( key, i * 7, key7, 0, 7 );
            DES des = new DES( key7 );
            des.encrypt( data, e8 );
            System.arraycopy( e8, 0, e, i * 8, 8 );
        }
    }
/**
* Generate the ANSI DES hash for the password associated with these credentials.
View Full Code Here

Examples of com.nimbusds.jose.JWEObject.encrypt()

    assertEquals("State check", JWEObject.State.UNENCRYPTED, jweObject.getState());

    JWEEncrypter encrypter = new RSAEncrypter(publicKey);

    jweObject.encrypt(encrypter);

    assertEquals("State check", JWEObject.State.ENCRYPTED, jweObject.getState());

    String jweString = jweObject.serialize();
View Full Code Here

Examples of com.openbravo.pos.util.AltEncrypter.encrypt()

        config.setProperty("erp.pos", jTextField2.getText());
        config.setProperty("erp.org", jTextField1.getText());
       
        config.setProperty("erp.user", jtxtName.getText());
        AltEncrypter cypher = new AltEncrypter("cypherkey" + jtxtName.getText());            
        config.setProperty("erp.password", "crypt:" + cypher.encrypt(new String(jtxtPassword.getPassword())));

        dirty.setDirty(false);
    }
   
    /** This method is called from within the constructor to
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.