Oracle的AES加密算法
FUNCTION FUN_AES_ENCRYPT ( V_STR VARCHAR2, V_KEY VARCHAR2 ) RETURN VARCHAR2 AS V_KEY_RAW RAW ( 24 ); V_STR_RAW RAW ( 2000 ); V_RETURN_STR VARCHAR2 ( 2000 ); V_TYPE PLS_INTEGER; BEGIN V_KEY_RAW := UTL_I18N.STRING_TO_RAW ( V_KEY, 'UTF8' ); V_STR_RAW := UTL_I18N.STRING_TO_RAW ( V_STR, 'UTF8' ); V_TYPE := DBMS_CRYPTO.ENCRYPT_AES128 + DBMS_CRYPTO.CHAIN_CBC + DBMS_CRYPTO.PAD_PKCS5; V_VI := UTL_I18N.STRING_TO_RAW ( '0102030405060708(偏移量)', 'UTF8' ); V_STR_RAW := DBMS_CRYPTO.ENCRYPT ( SRC => V_STR_RAW, typ => V_TYPE, key => V_KEY_RAW, vi => V_VI); V_RETURN_STR := RAWTOHEX( V_STR_RAW ); RETURN V_RETURN_STR; END;