Examples of encrypt()


Examples of org.jitterbit.util.crypto.PBEStringCryptographer.encrypt()

    public static String encryptString(String plainText, String passPhrase) throws ServerCryptoException {
        try {
            PBEStringCryptographer crypto = new DefaultPBEStringCryptographer(salt, 1);
            crypto.setAlgorithm(algorithm);
            crypto.setPassphrase(passPhrase);
            byte[] encrypted = crypto.encrypt(plainText);
            Base64 base64 = new Base64();
            return new String(base64.encode(encrypted));
        } catch (StringCryptographerException ex) {
            throw new ServerCryptoException(ex);
        } catch (StringEncryptionException ex) {
View Full Code Here

Examples of org.jresearch.gossip.util.DesEncrypter.encrypt()

    try {
     
      HashMap map = new HashMap();
      DesEncrypter encrypter = new DesEncrypter(
          IConst.VALUES.ENCRYPTER_KEY);
      map.put(IConst.CONFIG.MAILPASSWORD, encrypter
          .encrypt(((MailPasswordForm) form).getPassword()));
      dao.updateConstants(map);
      Configurator.getInstance().reload(getServlet().getServletContext());
      MailProcessor._mailSession = null;
      log(request, "status.UPDATE_MAILPASSWORD");
View Full Code Here

Examples of org.kapott.hbci.passport.HBCIPassportInternal.encrypt()

                    setParam("role","1");
                    setParam("alg",passport.getCryptAlg());
                    setParam("mode",passport.getCryptMode());
                    setParam("compfunc","0"); // TODO: spaeter kompression implementieren

                    byte[][] crypteds=passport.encrypt(getPlainString());

                    String msgPath=msg.getPath();
                    String dialogid=msg.getValueOfDE(msgPath+".MsgHead.dialogid");
                    String msgnum=msg.getValueOfDE(msgPath+".MsgHead.msgnum");
                    String segnum=msg.getValueOfDE(msgPath+".MsgTail.SegHead.seq");
View Full Code Here

Examples of org.keyczar.Crypter.encrypt()

        }

        Crypter crypter = secretImpl.getCrypter();
        byte[] ciphertext;
        try {
            ciphertext = crypter.encrypt(data);
        } catch (KeyczarException e) {
            throw new IllegalStateException("Error encrypting secret", e);
        }
        item.setCiphertext(ByteString.copyFrom(ciphertext));
View Full Code Here

Examples of org.keyczar.Encrypter.encrypt()

            plaintext = b.build().toByteArray();
        }

        Encrypter publicKeyEncrypter = getPublicKeyEncrypter(user.getPublicKey());
        byte[] ciphertext = publicKeyEncrypter.encrypt(plaintext);

        SecretData.Builder s = SecretData.newBuilder();
        s.setCiphertext(ByteString.copyFrom(ciphertext));
        s.setEncryptedWith(EncryptedWith.PUBLIC_KEY);
        s.setVersion(1);
View Full Code Here

Examples of org.keyczar.SignedSessionEncrypter.encrypt()

        getReader(algorithm, generateParams.get("cryptedKeySet"), generateParams.get("pubKey")));
    Signer signer = new Signer(getReader(
        generateParams.get("signer"), generateParams.get("cryptedKeySet"), ""));
    SignedSessionEncrypter crypter = new SignedSessionEncrypter(keyEncrypter, signer);
    String sessionMaterial = crypter.newSession();
    byte[] ciphertext = crypter.encrypt(testData.getBytes());
   
    Gson gson = new Gson();
    String output = gson.toJson(new SignedSessionOutput(ciphertext, sessionMaterial));
    return output.getBytes();
  }
View Full Code Here

Examples of org.mule.security.PasswordBasedEncryptionStrategy.encrypt()

    {
        PasswordBasedEncryptionStrategy pbe = new PasswordBasedEncryptionStrategy();
        pbe.setPassword("test");
        pbe.initialise();

        byte[] b = pbe.encrypt("hello".getBytes(), null);

        assertNotSame(new String(b), "hello");
        String s = new String(pbe.decrypt(b, null), "UTF-8");
        assertEquals("hello", s);
    }
View Full Code Here

Examples of org.mule.security.SecretKeyEncryptionStrategy.encrypt()

        SecretKeyEncryptionStrategy ske = new SecretKeyEncryptionStrategy();
        ske.setAlgorithm("Blowfish");
        ske.setKey("shhhhh");
        ske.initialise();

        byte[] b = ske.encrypt("hello".getBytes(), null);

        assertNotSame(new String(b), "hello");
        String s = new String(ske.decrypt(b, null), "UTF-8");
        assertEquals("hello", s);
    }
View Full Code Here

Examples of org.pentaho.platform.api.util.IPasswordService.encrypt()

  public void testPasswordService() {
    String password = "password"; //$NON-NLS-1$
    IPasswordService passwordService = new Base64PasswordService();
    String encryptedPassword = null;
    try {
      encryptedPassword = passwordService.encrypt( password );
      String decryptedPassword = passwordService.decrypt( encryptedPassword );
      assertEquals( password, decryptedPassword );
    } catch ( PasswordServiceException pse ) {
      fail( "should not have thrown the exception" ); //$NON-NLS-1$
      pse.printStackTrace();
View Full Code Here

Examples of org.platformlayer.service.nexus.utils.NexusLdapPasswords.encrypt()

  @Test
  public void testEncryption() throws Exception {
    NexusLdapPasswords passwords = new NexusLdapPasswords();

    String plaintext = "adminsecret";
    String ciphertext = passwords.encrypt(plaintext);
    System.out.println("ciphertext = " + ciphertext);

    assertStructure(ciphertext);

    String decrypted = passwords.decrypt(ciphertext);
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.