{"id":4338,"date":"2013-12-25T12:57:55","date_gmt":"2013-12-25T12:57:55","guid":{"rendered":"http:\/\/erpschools.com\/?p=4338"},"modified":"2014-12-05T10:06:23","modified_gmt":"2014-12-05T10:06:23","slug":"api-dbms_crypto-example","status":"publish","type":"post","link":"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example","title":{"rendered":"API: DBMS_CRYPTO: encrypt and decrypt information"},"content":{"rendered":"<p>To Encrypt or decrypt, we will need a key. This key will be stored in a table which can be accessed only by the authorized personnel.<br \/>\nIn the below examples, the key has been hardcoded.<\/p>\n<p>dbms_crypto example to encrypt information<\/p>\n<p><code><br \/>\nDeclare<\/p>\n<p>l_key varchar2(2000) := '1234567890123456';<br \/>\nl_mod number := dbms_crypto.ENCRYPT_AES128<br \/>\n+ dbms_crypto.CHAIN_CBC<br \/>\n+ dbms_crypto.PAD_PKCS5;<br \/>\nl_enc raw (2000);<br \/>\nbegin<\/p>\n<p>l_enc := dbms_crypto.encrypt<br \/>\n(<br \/>\nUTL_I18N.STRING_TO_RAW (p_in_val, 'AL32UTF8'),<br \/>\nl_mod,<br \/>\nUTL_I18N.STRING_TO_RAW (l_key, 'AL32UTF8')<br \/>\n);<\/p>\n<p>end;<\/p>\n<p><\/code><\/p>\n<p>dbms_crypto example to decrypt information<\/p>\n<p><code><br \/>\nDeclare<\/p>\n<p>l_key varchar2(2000) := '1234567890123456';<br \/>\nlv_in_val raw (2000) := hextoraw(p_in_val);<br \/>\nl_mod number := dbms_crypto.ENCRYPT_AES128<br \/>\n+ dbms_crypto.CHAIN_CBC<br \/>\n+ dbms_crypto.PAD_PKCS5;<br \/>\nl_dec raw (2000);<\/p>\n<p>begin<\/p>\n<p><code> l_dec := dbms_crypto.decrypt<br \/>\n(<br \/>\nlv_in_val,<br \/>\nl_mod,<br \/>\nUTL_I18N.STRING_TO_RAW (l_key, 'AL32UTF8')<br \/>\n);<br \/>\ndbms_output.put_line<br \/>\n('Decrypted='||utl_i18n.raw_to_char(l_dec));<br \/>\nend;<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To Encrypt or decrypt, we will need a key. This key will be stored in a table which can be accessed only by the authorized personnel. In the below examples, the key has been hardcoded. dbms_crypto example to encrypt information Declare l_key varchar2(2000) := &#8216;1234567890123456&#8217;; l_mod number := dbms_crypto.ENCRYPT_AES128 + dbms_crypto.CHAIN_CBC + dbms_crypto.PAD_PKCS5; l_enc raw [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[500],"tags":[530,155],"class_list":["post-4338","post","type-post","status-publish","format-standard","hentry","category-sysadmin-api","tag-api","tag-dbms_crypto"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>dbms_crypto example<\/title>\n<meta name=\"description\" content=\"dbms_crypto example to encrypt and decrypt information\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Haritha\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example#article\",\"isPartOf\":{\"@id\":\"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example\"},\"author\":{\"name\":\"Haritha\",\"@id\":\"https:\/\/erpschools.com\/erps\/#\/schema\/person\/a72dd96f9fdf6f7a93ca9ad64865da2d\"},\"headline\":\"API: DBMS_CRYPTO: encrypt and decrypt information\",\"datePublished\":\"2013-12-25T12:57:55+00:00\",\"dateModified\":\"2014-12-05T10:06:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example\"},\"wordCount\":54,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/erpschools.com\/erps\/#organization\"},\"keywords\":[\"API\",\"dbms_crypto\"],\"articleSection\":[\"Sysadmin API\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example\",\"url\":\"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example\",\"name\":\"dbms_crypto example\",\"isPartOf\":{\"@id\":\"https:\/\/erpschools.com\/erps\/#website\"},\"datePublished\":\"2013-12-25T12:57:55+00:00\",\"dateModified\":\"2014-12-05T10:06:23+00:00\",\"description\":\"dbms_crypto example to encrypt and decrypt information\",\"breadcrumb\":{\"@id\":\"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/erpschools.com\/erps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"API: DBMS_CRYPTO: encrypt and decrypt information\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/erpschools.com\/erps\/#website\",\"url\":\"https:\/\/erpschools.com\/erps\/\",\"name\":\"erpSchools\",\"description\":\"Oracle Apps\",\"publisher\":{\"@id\":\"https:\/\/erpschools.com\/erps\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/erpschools.com\/erps\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/erpschools.com\/erps\/#organization\",\"name\":\"erpSchools\",\"url\":\"https:\/\/erpschools.com\/erps\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/erpschools.com\/erps\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/erps_logo7.png\",\"contentUrl\":\"https:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/erps_logo7.png\",\"width\":250,\"height\":60,\"caption\":\"erpSchools\"},\"image\":{\"@id\":\"https:\/\/erpschools.com\/erps\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"http:\/\/facebook.com\/erpschools\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/erpschools.com\/erps\/#\/schema\/person\/a72dd96f9fdf6f7a93ca9ad64865da2d\",\"name\":\"Haritha\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/erpschools.com\/erps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/db8f3d6beecff36e02ff1416b699c7d7e0cffaaf424445e3a61a0d1637847fc2?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/db8f3d6beecff36e02ff1416b699c7d7e0cffaaf424445e3a61a0d1637847fc2?s=96&d=blank&r=g\",\"caption\":\"Haritha\"},\"sameAs\":[\"http:\/\/www.erpschools.com\"],\"url\":\"https:\/\/erpschools.com\/erps\/author\/haritha\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"dbms_crypto example","description":"dbms_crypto example to encrypt and decrypt information","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example","twitter_misc":{"Written by":"Haritha","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example#article","isPartOf":{"@id":"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example"},"author":{"name":"Haritha","@id":"https:\/\/erpschools.com\/erps\/#\/schema\/person\/a72dd96f9fdf6f7a93ca9ad64865da2d"},"headline":"API: DBMS_CRYPTO: encrypt and decrypt information","datePublished":"2013-12-25T12:57:55+00:00","dateModified":"2014-12-05T10:06:23+00:00","mainEntityOfPage":{"@id":"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example"},"wordCount":54,"commentCount":0,"publisher":{"@id":"https:\/\/erpschools.com\/erps\/#organization"},"keywords":["API","dbms_crypto"],"articleSection":["Sysadmin API"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example#respond"]}]},{"@type":"WebPage","@id":"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example","url":"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example","name":"dbms_crypto example","isPartOf":{"@id":"https:\/\/erpschools.com\/erps\/#website"},"datePublished":"2013-12-25T12:57:55+00:00","dateModified":"2014-12-05T10:06:23+00:00","description":"dbms_crypto example to encrypt and decrypt information","breadcrumb":{"@id":"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/erpschools.com\/erps\/api\/sysadmin-api\/api-dbms_crypto-example#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/erpschools.com\/erps"},{"@type":"ListItem","position":2,"name":"API: DBMS_CRYPTO: encrypt and decrypt information"}]},{"@type":"WebSite","@id":"https:\/\/erpschools.com\/erps\/#website","url":"https:\/\/erpschools.com\/erps\/","name":"erpSchools","description":"Oracle Apps","publisher":{"@id":"https:\/\/erpschools.com\/erps\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/erpschools.com\/erps\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/erpschools.com\/erps\/#organization","name":"erpSchools","url":"https:\/\/erpschools.com\/erps\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/erpschools.com\/erps\/#\/schema\/logo\/image\/","url":"https:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/erps_logo7.png","contentUrl":"https:\/\/erpschools.com\/erps\/wp-content\/uploads\/img\/erps_logo7.png","width":250,"height":60,"caption":"erpSchools"},"image":{"@id":"https:\/\/erpschools.com\/erps\/#\/schema\/logo\/image\/"},"sameAs":["http:\/\/facebook.com\/erpschools"]},{"@type":"Person","@id":"https:\/\/erpschools.com\/erps\/#\/schema\/person\/a72dd96f9fdf6f7a93ca9ad64865da2d","name":"Haritha","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/erpschools.com\/erps\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/db8f3d6beecff36e02ff1416b699c7d7e0cffaaf424445e3a61a0d1637847fc2?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/db8f3d6beecff36e02ff1416b699c7d7e0cffaaf424445e3a61a0d1637847fc2?s=96&d=blank&r=g","caption":"Haritha"},"sameAs":["http:\/\/www.erpschools.com"],"url":"https:\/\/erpschools.com\/erps\/author\/haritha"}]}},"_links":{"self":[{"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/posts\/4338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/comments?post=4338"}],"version-history":[{"count":0,"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/posts\/4338\/revisions"}],"wp:attachment":[{"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/media?parent=4338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/categories?post=4338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/erpschools.com\/erps\/wp-json\/wp\/v2\/tags?post=4338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}