Examples of encrypt()


Examples of org.apache.openejb.resource.jdbc.cipher.PlainTextPasswordCipher.encrypt()

 
  private static final String PLAIN_PWD = "david";
 
    public void testPlainCodec() {
      PasswordCipher cipher = new PlainTextPasswordCipher();
      assertEquals(PLAIN_PWD, new String(cipher.encrypt(PLAIN_PWD)));
      assertEquals(PLAIN_PWD, cipher.decrypt(PLAIN_PWD.toCharArray()));
    }
 
  public void testStaticDesCodec() {
    PasswordCipher cipher = new StaticDESPasswordCipher();
View Full Code Here

Examples of org.apache.openejb.resource.jdbc.cipher.StaticDESPasswordCipher.encrypt()

      assertEquals(PLAIN_PWD, cipher.decrypt(PLAIN_PWD.toCharArray()));
    }
 
  public void testStaticDesCodec() {
    PasswordCipher cipher = new StaticDESPasswordCipher();
    char[] tmp = cipher.encrypt(PLAIN_PWD);
    assertEquals(PLAIN_PWD, cipher.decrypt(tmp));
    }
 
  public void testGetDataSourcePlugin() throws Exception {
        // all current known plugins
View Full Code Here

Examples of org.apache.shindig.auth.BlobCrypterSecurityToken.encrypt()

         t.setModuleId(moduleId);
         t.setOwnerId(owner);
         t.setViewerId(viewer);
         t.setTrustedJson("trusted");

         return t.encrypt();
      }
      catch (IOException e)
      {
         e.printStackTrace(); // To change body of catch statement use File |
         // Settings | File Templates.
View Full Code Here

Examples of org.apache.shiro.crypto.AesCipherService.encrypt()

     * @param key      the encryption key
     * @return encrypted password in base64 encoding
     */
    public static String encryptPassword(String password, byte[] key) {
        AesCipherService cipherService = new AesCipherService();
        ByteSource encrypted = cipherService.encrypt(password.getBytes(), key);
        return encrypted.toBase64();
    }

    /**
     * Returns decrypted password using given key
View Full Code Here

Examples of org.apache.shiro.crypto.CipherService.encrypt()

     */
    protected byte[] encrypt(byte[] serialized) {
        byte[] value = serialized;
        CipherService cipherService = getCipherService();
        if (cipherService != null) {
            ByteSource byteSource = cipherService.encrypt(serialized, getEncryptionCipherKey());
            value = byteSource.getBytes();
        }
        return value;
    }

View Full Code Here

Examples of org.apache.turbine.services.crypto.CryptoAlgorithm.encrypt()

            {
                CryptoAlgorithm ca = cs.getCryptoAlgorithm(algorithm);

                ca.setSeed(salt);

                String result = ca.encrypt(password);

                return result;
            }
            catch (Exception e)
            {
View Full Code Here

Examples of org.apache.uima.ducc.common.crypto.Crypto.encrypt()

    try {
      String user = System.getProperty("user.name");
      String home = System.getProperty("user.home");
      Crypto crypto = new Crypto(user,home);
      String message = "Hello DUCC!";
      byte[] cypheredMessage = crypto.encrypt(message);
      Properties properties = new Properties();
      String key_signature = "signature";
      properties.put(key_signature, cypheredMessage);
      cypheredMessage = (byte[]) properties.get(key_signature);
      Object decypheredMessage = crypto.decrypt(cypheredMessage);
View Full Code Here

Examples of org.apache.xml.security.algorithms.encryption.EncryptionMethod.encrypt()

      EncryptionMethod em = this.getEncryptionMethod();
      Canonicalizer c14n =
         Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS);
      byte plaintext[] = c14n.canonicalizeSubtree(plaintextElement);
      byte ciphertext[] = em.encrypt(plaintext, secretKey);

      this.getCipherData().setCipherValue(new CipherValue(this._doc,
              ciphertext));
      this.setType(EncryptionConstants.TYPE_ELEMENT);
      EncryptedData.replace(plaintextElement, this._constructionElement);
View Full Code Here

Examples of org.arch.encrypt.SimpleEncrypt.encrypt()

    switch (type)
    {
      case SE1:
      {
        SimpleEncrypt se1 = new SimpleEncrypt();
        se1.encrypt(content);
        break;
      }
      case RC4:
      {
        content = RC4.encrypt(buffer);
View Full Code Here

Examples of org.bouncycastle.crypto.engines.ThreefishCipher.encrypt()

            tweak.startNewBlockType(UbiTweak.Config);
            tweak.setFinalBlock(true);
            tweak.setBitsProcessed(32);

            cipher.setTweak(tweak.getTweak());
            cipher.encrypt(ConfigString, ConfigValue);

            ConfigValue[0] ^= ConfigString[0];
            ConfigValue[1] ^= ConfigString[1];
            ConfigValue[2] ^= ConfigString[2];
        }
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.