All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.polyglotted.crypto.api.Crypto Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
package org.polyglotted.crypto.api;

import javax.crypto.Cipher;


/**
 * Marker interface for all RSA crtpto classes
 * 
 * @author Shankar Vasudevan
 */
public interface Crypto {

    String RSA_ALGORITHM = "RSA";
    String AES_ALGORITHM = "AES/CBC/PKCS5Padding";

    /**
     * Perform encrypt or decrypt action
     * 
     * @param bytes
     *            the byte[] to crypt
     * @return the result byte[]
     */
    byte[] crypt(byte[] bytes);

    /**
     * Perform encrypt or decrypt action
     * 
     * @param text
     *            the String to crypt
     * @return the result String
     */
    String crypt(String text);

    /**
     * @return the cipher that is used by this crypto
     */
    Cipher getCipher();

    /**
     * @return the algorithm that is used by this crypto
     */
    String getAlgorithm();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy