This is an old thread, but I thought I would post this SQL as a method of scrambling text. This can be used for scrambling, but it is not cryptography. The resulting string can be used in a translate function:
WITH
starter
AS
(SELECT ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' AS a
FROM DUAL),
scramble (newstr, remaining, rndm)
AS
(SELECT SUBSTR (a, 1, 1)
, SUBSTR (a, 2) AS remaining
, TRUNC (DBMS_RANDOM.VALUE (1, LENGTH (a) - 1)) AS rndm
FROM starter
UNION ALL
SELECT newstr || SUBSTR (remaining, rndm, 1)
, CASE rndm
WHEN 1
THEN
SUBSTR (remaining, 2)
WHEN LENGTH (remaining)
THEN
SUBSTR (remaining, 1, LENGTH (remaining - 1))
ELSE
SUBSTR (remaining, 1, rndm - 1)
|| SUBSTR (remaining, rndm + 1)
END AS remaining
, TRUNC (DBMS_RANDOM.VALUE (1, LENGTH (remaining) - 1)) AS rndm
FROM scramble
WHERE LENGTH (remaining) > 0)
SELECT *
FROM scramble where remaining is null;
This is done using DBMS_RANDOM as a pseudo random number generator. You will want to call dbms_random.seed to make it truly random.
Use the resulting string in a translate function:
SELECT translate (
string
, ' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
, ' AvjcMlo1KOH45UZfmXipnPEgGBRSza2I63kNCWQwYuF8qh0teDr7TybVJLxds9')
FROM sourcetable