Examples of AESEncrypter


Examples of com.alibaba.citrus.service.requestcontext.session.encrypter.impl.AesEncrypter

        StoresConfig stores = config.getStores();
        CookieStoreImpl cookieStore = (CookieStoreImpl) stores.getStore("s1");
        SessionEncoder[] encoders = getFieldValue(cookieStore, "encoders", SessionEncoder[].class);
        SerializationEncoder sencoder = (SerializationEncoder) encoders[0];
        AesEncrypter aes = (AesEncrypter) sencoder.getEncrypter();

        assertEquals(128, aes.getKeySize());
        assertEquals(256, aes.getPoolSize());
    }
View Full Code Here

Examples of com.alibaba.citrus.service.requestcontext.session.encrypter.impl.AesEncrypter

        StoresConfig stores = config.getStores();
        CookieStoreImpl cookieStore = (CookieStoreImpl) stores.getStore("s1");
        SessionEncoder[] encoders = getFieldValue(cookieStore, "encoders", SessionEncoder[].class);
        SerializationEncoder sencoder = (SerializationEncoder) encoders[0];
        AesEncrypter aes = (AesEncrypter) sencoder.getEncrypter();

        assertEquals(128, aes.getKeySize());
        assertEquals(256, aes.getPoolSize());
    }
View Full Code Here

Examples of com.zwl.util.zip.impl.AESEncrypter

  }

  // TODO - zipEntry might use extended local header
  protected void add(ZipEntry zipEntry, ZipFileEntryInputStream zipData, String password)
      throws IOException, UnsupportedEncodingException {
    AESEncrypter aesEncrypter = new AESEncrypterBC(password.getBytes("iso-8859-1"));

    ExtZipEntry entry = new ExtZipEntry(zipEntry.getName());
    entry.setMethod(zipEntry.getMethod());
    entry.setSize(zipEntry.getSize());
    entry.setCompressedSize(zipEntry.getCompressedSize() + 28);
    entry.setTime(zipEntry.getTime());
    entry.initEncryptedEntry();

    zipOS.putNextEntry(entry);
    // ZIP-file data contains: 1. salt 2. pwVerification 3. encryptedContent 4. authenticationCode
    zipOS.writeBytes(aesEncrypter.getSalt());
    zipOS.writeBytes(aesEncrypter.getPwVerification());

    byte[] data = new byte[1024];
    int read = zipData.read(data);
    while (read != -1) {
      aesEncrypter.encrypt(data, read);
      zipOS.writeBytes(data, 0, read);
      read = zipData.read(data);
    }

    byte[] finalAuthentication = aesEncrypter.getFinalAuthentication();
    if (LOG.isLoggable(Level.FINE)) {
      LOG.fine("finalAuthentication=" + Arrays.toString(finalAuthentication) + " at pos="
          + zipOS.getWritten());
    }
View Full Code Here

Examples of com.zwl.util.zip.impl.AESEncrypter

   * @param name of the new zipEntry within the zip file
   * @param is provides the data to be added 
   * @param password to be used for encryption
   */
  public void add(String name, InputStream is, String password) throws IOException,  UnsupportedEncodingException {
    AESEncrypter aesEncrypter = new AESEncrypterBC(password.getBytes("iso-8859-1"));

    // Compress contents of inputStream and report on bytes read
    // we need to first compress to know details of entry
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    DeflaterOutputStream dos = new DeflaterOutputStream(bos, new Deflater(9, true), 8 * 1024);
    int read, inputLen = 0;
    byte[] buf = new byte[8 * 1024];
    while ((read = is.read(buf)) > 0) {
      inputLen += read;
      dos.write(buf, 0, read);
    }
    dos.close();
    byte[] data = bos.toByteArray();

    ExtZipEntry entry = new ExtZipEntry(name);
    entry.setMethod(ZipEntry.DEFLATED);
    entry.setSize(inputLen);
    entry.setCompressedSize(data.length + 28);
    entry.setTime((new java.util.Date()).getTime());
    entry.initEncryptedEntry();

    zipOS.putNextEntry(entry);
    // ZIP-file data contains: 1. salt 2. pwVerification 3. encryptedContent 4. authenticationCode
    zipOS.writeBytes(aesEncrypter.getSalt());
    zipOS.writeBytes(aesEncrypter.getPwVerification());

    aesEncrypter.encrypt(data, data.length);
    zipOS.writeBytes(data, 0, data.length);

    byte[] finalAuthentication = aesEncrypter.getFinalAuthentication();
    if (LOG.isLoggable(Level.FINE)) {
      LOG.fine("finalAuthentication=" + Arrays.toString(finalAuthentication) + " at pos="
          + zipOS.getWritten());
    }

View Full Code Here

Examples of cx.fbn.nevernote.utilities.AESEncrypter

        setupOnlineMenu();
        return;
      }
     
      OAuthTokenizer tokenizer = new OAuthTokenizer();
      AESEncrypter aes = new AESEncrypter();
      try {
      aes.decrypt(new FileInputStream(Global.getFileManager().getHomeDirFile("oauth.txt")));
    } catch (FileNotFoundException e) {
      // File not found, so we'll just get empty strings anyway.
    }
     
          
    if (Global.getProxyValue("url").equals("")) {
      System.setProperty("http.proxyHost","") ;
      System.setProperty("http.proxyPort", "") ;
      System.setProperty("https.proxyHost","") ;
      System.setProperty("https.proxyPort", "") ;     
    } else {
      // PROXY
      System.setProperty("http.proxyHost",Global.getProxyValue("url")) ;
      System.setProperty("http.proxyPort", Global.getProxyValue("port")) ;
      System.setProperty("https.proxyHost",Global.getProxyValue("url")) ;
      System.setProperty("https.proxyPort", Global.getProxyValue("port")) ;
      if (Global.getProxyValue("userid").equals("")) {
        Authenticator.setDefault(new Authenticator() {
          @Override
          protected PasswordAuthentication getPasswordAuthentication() {
            return new
            PasswordAuthentication(Global.getProxyValue("userid"),Global.getProxyValue("password").toCharArray());
            }
          });
        }
      }

    syncRunner.userStoreUrl = Global.userStoreUrl;
    syncRunner.noteStoreUrl = Global.noteStoreUrl;
    syncRunner.noteStoreUrlBase = Global.noteStoreUrlBase;
   
   
   
    String authString = aes.getString();
    if (!authString.equals("")) {
      tokenizer.tokenize(authString);
      syncRunner.authToken = tokenizer.oauth_token;
        syncRunner.enConnect();
    }   

    Global.isConnected = syncRunner.isConnected;
   
    if (!Global.isConnected) {
        OAuthWindow window = new OAuthWindow(logger);
        if (window.error) {
          setMessage(window.errorMessage);
          return;
        }
        window.exec();
        if (window.error) {
          setMessage(window.errorMessage);
          return;
      }
        tokenizer.tokenize(window.response);
        if (tokenizer.oauth_token.equals("")) {
          setMessage(tr("Invalid authorization token received."));
          return;
        }
        aes.setString(window.response);
        try {
        aes.encrypt(new FileOutputStream(Global.getFileManager().getHomeDirFile("oauth.txt")));
      } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
        syncRunner.authToken = tokenizer.oauth_token;
View Full Code Here

Examples of de.idyl.winzipaes.impl.AESEncrypter

            throw new IllegalStateException("File " + zipFile.getAbsolutePath() + " already exists");
        }
        this.password = password;

        try {
            AESEncrypter encrypter = new AESEncrypterBC();
            this.encrypter = new AesZipFileEncrypter(zipFile, encrypter);
        } catch (IOException ioe) {
            throw new RuntimeException(ioe);
        }
        logger.infof("Exporting into zip file %s", zipFile.getAbsolutePath());
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.