Name | Code | Description |
---|---|---|
gc_hash_md4 | gc_hash_md4 constant pls_integer := 1; |
|
gc_hash_md5 | gc_hash_md5 constant pls_integer := 2; |
|
gc_hash_sh1 | gc_hash_sh1 constant pls_integer := 3; |
|
gc_hash_sh224 | gc_hash_sh224 constant pls_integer := 11; |
|
gc_hash_sh256 | gc_hash_sh256 constant pls_integer := 4; |
|
gc_hash_sh384 | gc_hash_sh384 constant pls_integer := 5; |
|
gc_hash_sh512 | gc_hash_sh512 constant pls_integer := 6; |
|
gc_hash_ripemd160 | gc_hash_ripemd160 constant pls_integer := 15; |
|
gc_hmac_md4 | gc_hmac_md4 constant pls_integer := 0; |
|
gc_hmac_md5 | gc_hmac_md5 constant pls_integer := 1; |
|
gc_hmac_sh1 | gc_hmac_sh1 constant pls_integer := 2; |
|
gc_hmac_sh224 | gc_hmac_sh224 constant pls_integer := 10; |
|
gc_hmac_sh256 | gc_hmac_sh256 constant pls_integer := 3; |
|
gc_hmac_sh384 | gc_hmac_sh384 constant pls_integer := 4; |
|
gc_hmac_sh512 | gc_hmac_sh512 constant pls_integer := 5; |
|
gc_hmac_ripemd160 | gc_hmac_ripemd160 constant pls_integer := 14; |
|
gc_encrypt_des | gc_encrypt_des constant pls_integer := 1; |
Generates hash with raw values
See oos_util_crypto.hash_str
to handle wrapping
function hash(
p_src raw,
p_typ pls_integer)
return raw
Name | Description |
---|---|
p_src |
|
p_typ |
see oos_util_crypto.gc_hash* variables |
select
rawtohex(
oos_util_crypto.hash(
p_src => sys.utl_raw.cast_to_raw('hello'),
p_typ => 4 -- oos_util_crypto.gc_hash_sh256
)
) example
from dual
;
EXAMPLE
2CF24DBA5FB0A30E26E83B2AC5B9E29E1B161E5C1FA7425E73043362938B9824
Generates hash
function hash_str(
p_src varchar2,
p_typ pls_integer)
return varchar2
Name | Description |
---|---|
p_src |
|
p_typ |
see oos_util_crypto.gc_hash* variables |
return | Hex hashed value as a string |
select
oos_util_crypto.hash_str(
p_src => 'hello',
p_typ => 4 -- oos_util_crypto.gc_hash_md5
) example
from dual
;
EXAMPLE
2CF24DBA5FB0A30E26E83B2AC5B9E29E1B161E5C1FA7425E73043362938B9824
Generates mac
Note: see mac_str for string inputs
function mac(
p_src raw,
p_typ pls_integer,
p_key raw )
return raw
Name | Description |
---|---|
p_src |
|
p_typ |
see oos_util_crypto.gc_hmac* variables |
p_key |
secret key |
select
rawtohex(
oos_util_crypto.mac(
p_src => utl_raw.cast_to_raw('hello'),
p_typ => 3, -- oos_util_crypto.gc_hmac_sh256
p_key => utl_raw.cast_to_raw('abc')
)
) example
from dual
;
EXAMPLE
F3166A3A404599D2046ED2AAE479B37D54B51D2E85259C9E314042753BE7D813
Generates mac with string input / output
function mac_str(
p_src varchar2,
p_typ pls_integer,
p_key varchar2 )
return varchar2
Name | Description |
---|---|
p_src |
|
p_typ |
see oos_util_crypto.gc_hmac* variables |
p_key |
secret key |
return | mac hex value as varchar2 |
select
oos_util_crypto.mac_str(
p_src => 'hello',
p_typ => 3, -- oos_util_crypto.gc_hmac_sh256
p_key => 'abc'
) example
from dual
;
EXAMPLE
F3166A3A404599D2046ED2AAE479B37D54B51D2E85259C9E314042753BE7D813