DBMS_OBFUSCATION_TOOLKIT.des3encrypt : DBMS_OBFUSCATION_TOOLKIT « System Packages « Oracle PL / SQL

Oracle PL / SQL
1. Aggregate Functions
2. Analytical Functions
3. Char Functions
4. Constraints
5. Conversion Functions
6. Cursor
7. Data Type
8. Date Timezone
9. Hierarchical Query
10. Index
11. Insert Delete Update
12. Large Objects
13. Numeric Math Functions
14. Object Oriented Database
15. PL SQL
16. Regular Expressions
17. Report Column Page
18. Result Set
19. Select Query
20. Sequence
21. SQL Plus
22. Stored Procedure Function
23. Subquery
24. System Packages
25. System Tables Views
26. Table
27. Table Joins
28. Trigger
29. User Previliege
30. View
31. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Oracle PL / SQL » System Packages » DBMS_OBFUSCATION_TOOLKIT 
DBMS_OBFUSCATION_TOOLKIT.des3encrypt
  
SQL> CREATE OR REPLACE FUNCTION get_enc_val (
  2     p_in_val   IN   VARCHAR2,
  3     p_key      IN   VARCHAR2,
  4     p_iv       IN   VARCHAR2 := NULL,
  5     p_which    IN   NUMBER := 0
  6  )
  7     RETURN VARCHAR2
  8  IS
  9     l_enc_val   VARCHAR2 (200);
 10     l_in_val    VARCHAR2 (200);
 11     l_iv        VARCHAR2 (200);
 12  BEGIN
 13     IF p_which = 0
 14     THEN
 15        IF LENGTH (p_key16
 16        THEN
 17           raise_application_error
 18                                 (-20001,
 19                                  'Key length less than 16 for two-pass scheme'
 20                                 );
 21        END IF;
 22     ELSIF p_which = 1
 23     THEN
 24        IF LENGTH (p_key24
 25        THEN
 26           raise_application_error
 27                               (-20002,
 28                                'Key length less than 24 for three-pass scheme'
 29                               );
 30        END IF;
 31     ELSE
 32        raise_application_error (-20003,
 33                                    'Incorrect value of which '
 34                                 || p_which
 35                                 || '; must be or 1'
 36                                );
 37     END IF;
 38
 39     l_in_val := RPAD (p_in_val, (* ROUND (LENGTH (p_in_val808));
 40     l_iv := RPAD (p_iv, (* ROUND (LENGTH (p_iv808));
 41     l_enc_val :=
 42        DBMS_OBFUSCATION_TOOLKIT.des3encrypt (input_string      => l_in_val,
 43                                              key_string        => p_key,
 44                                              iv_string         => l_iv,
 45                                              which             => p_which
 46                                             );
 47     l_enc_val := RAWTOHEX (UTL_RAW.cast_to_raw (l_enc_val));
 48     RETURN l_enc_val;
 49  END;
 50  /


Function created.

SQL>

   
  
Related examples in the same category
1. DBMS_OBFUSCATION_TOOLKIT.des3getkey
2. DBMS_OBFUSCATION_TOOLKIT.md5 and RAWTOHEX
3. DBMS_OBFUSCATION_TOOLKIT.des3decrypt
4. dbms_obfuscation_toolkit.md5
5. Demonstrate DES3 encryption
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.