001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.wicket.util.crypt;
018
019/**
020 * Encryption and decryption implementations are accessed through this interface. It provide some
021 * simple means to encrypt and decrypt strings, like passwords etc.. It depends on the
022 * implementation itself which algorithms are used to en-/decrypt the data.
023 * <p>
024 * If you value the privacy of your websites users, then please consider using a one-way encryption
025 * algorithm instead of the Wicket provided ICrypt implementations. The intention of these
026 * encryption facilities is to keep passwords private when stored in cookies or in the session.The
027 * implementation of the encryption algorithm may change between releases. As such, this interface
028 * and its implementations are not intended and should not be used as an encryption facility for
029 * persistent values.
030 * 
031 * @author Juergen Donnerstag
032 */
033public interface ICrypt
034{
035        /**
036         * Decrypts a string using URL and filename safe Base64 decoding.
037         * 
038         * @param text
039         *            the text to decrypt
040         * @return the decrypted string.
041         * @since 1.2
042         */
043        String decryptUrlSafe(final String text);
044
045        /**
046         * Encrypts a string using URL and filename safe Base64 encoding.
047         * 
048         * @param plainText
049         * @return encrypted string
050         * @since 1.2
051         */
052        String encryptUrlSafe(final String plainText);
053}