001package org.kuali.common.util.enc; 002 003import java.util.Properties; 004 005public interface EncryptionService { 006 007 /** 008 * Encrypt the text and prefix it with <code>enc--</code>. If the text is already encrypted, do nothing. 009 * 010 * <pre> 011 * foo -> x7UiXya -> enc--x7UiXya 012 * </pre> 013 */ 014 String encrypt(String plainText); 015 016 /** 017 * Remove the <code>enc--</code> prefix and then decrypt it. If the text is not encrypted, do nothing. 018 * 019 * <pre> 020 * enc--x7UiXya -> x7UiXya -> foo 021 * </pre> 022 */ 023 String decrypt(String encryptedText); 024 025 /** 026 * Detect any encrypted property values and decrypt them 027 */ 028 void decrypt(Properties properties); 029 030 /** 031 * Encrypt any property values that are not already encrypted. 032 */ 033 void encrypt(Properties properties); 034 035}