Date field encryption using Dbms_Obfuscation_Toolkit.DESENCRYPT

Hi,
I need to encrypt the date field in the table using Dbms_Obfuscation_Toolkit.DESENCRYPT .
This is an table is an existing table and is accessed by many interfaces, so we cannot change the column type of this date field.
Is there a possibility of encrypting the date field and store it in the same column (DATE type).
And access this using Dbms_Obfuscation_Toolkit.DESDECRYPT.
We are using Oracle 11.2.0.2.0.
Thanks in advance.
Agathya

>
Is there a possibility of encrypting the date field and store it in the same column (DATE type).
>
No - the DESENCRYPT procedure returns a RAW value which can't be stored in a DATE column.
See DESENCRYPT Procedures and Functions in Chapter 82 (DBMS_OBFUSCATION_TOOLKIT) of the PL/SQl Packages and Types Doc
http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_obtool.htm#i997215
For what you want to do just use the ENCRYPT option of the CREATE TABLE or ALTER TABLE statements.
See Using Transparent Data Encryption in the Advanced Security Admin Guide
http://docs.oracle.com/cd/B28359_01/network.111/b28530/asotrans.htm#BABJJAIG
>
3.2 Using Transparent Data Encryption
The following steps discuss using transparent data encryption:
•Enabling Transparent Data Encryption
•Setting and Resetting theMaster Encryption Key
•Opening the Encrypted Wallet
•Creating Tables with Encrypted Columns
•Encrypting Columns in Existing Tables
•Creating an Index on an Encrypted Column
•Adding or Removing Salt from an Encrypted Column
•Changing the Encryption Key or Algorithm for Tables Containing Encrypted Columns
>
Section 3.2.5.2 Encrypting an Unencrypted Column shows the ALTER TABLE statement for encrypting an existing column - this would leave the column as a DATE and you would work with it normally
>
3.2.5.2 Encrypting an Unencrypted Column
To encrypt an unencrypted column, use the ALTER TABLE MODIFY command, specifying the unencrypted column with the ENCRYPT clause. Example 3-7 encrypts the first_name column in the employee table.
Example 3-7 Encrypting an Unencrypted Column
ALTER TABLE employee MODIFY (first_name ENCRYPT);
The first_name column is encrypted with the default AES192 algorithm. Salt is added to the data, by default.
You can choose to encrypt the column using a different algorithm. You can also specify NO SALT, if you wish to index the column.

Similar Messages

  • When I get a date field value using the Oracle thin (type 4) JDBC driver...

    ....in 'DD-MMM-YY' format from an Oracle 8i database and pass it in to the java.util.Date() constructor, I get a IllegalArgumentException. This error doesn't occur when I use the type 2 driver, so it is apparently a driver-specific thing. It happens on both Win32 and Linux.
    Has anyone seen this before? Is there a newer version of the Oracle thin (i.e., type 4) driver than is listed here?
    http://web77-02.us.oracle.com/software/tech/java/sqlj_jdbc/content.html
    Thanks,
    Tom
    [email protected]

    Yup, that original post didn't make much sense, did it? Let's try again.
    I've got an EJB app that runs on WebLogic 6.0 (on Solaris in production, on Win2K for development) and accesses an Oracle 8i database. This app currently uses the Oracle type 2 JDBC drivers. All is well.
    So I wanted to see how it would run on Linux. I've got a Redhat 7.1 box handy, so I installed the JDK and WL6.0 and slapped the ear file on there. Problem! Can't deploy because there are no Oracle drivers on this machine!
    Makes sense. So I started looking around, and it seems installing Oracle on a RH 7.1 box involves patching glibc and other such nastiness. So let's just try the type 4 JDBC driver - no glibc patch, no shared object libraries, just good 'ol pure Java talking to Oracle on port 1521.
    Once I had the URLs and whatnot set up, the app connected to the DB just fine, created the connection pool, read some data, etc. But when my app read a date from the DB and instantiates a new java.util.Date object, I got an IllegalArgumentException - i.e., the date can't be parsed.
    "Hmm... that's odd", I thought, so back I went to my trusty Win2K machine, modified my configuration files to use the type 4 driver and - same error! So I switched back to the type 2 driver - and everything works fine, Dates and all. Hmmm.....
    As you correctly state, that Date constructor is deprecated and I should use DateFormats and GregorianCalendars and whatnot instead.
    But has anyone seen this weird behavior before - code that works fine on a type 2 driver starts throwing exceptions when used with a type 4 driver? Anyone have any solutions?
    Thanks much,
    Tom

  • Getting a calendar to show up with a date field when using Adobe Standard 6.0.3

    Is the calendar available with this version of Adobe Standard? I know with Adobe Reader 7.0 it is, but we have to use Adobe Standard 6.0.3 and I would like to make use of the calendar.
    Thanks.

    The calendar control was only implemented for windows in the AcroForms plugin for Reader 7. There is no alternative in 6.x.

  • Looking for a third party utility to replace a file's "modified Date" field

    For video files, apparently the organizer displays the thumbnails with the date taken from the file's "modified date" field. For some wierd reason (which I'm discussing with Adobe CS) the organizer changed the date of all my videos in the "modified date" field, so now the chronology of all my video clips in the organizer went down the drain.
    Is there a third party utility to replace the "modified date" field of a file with the original shot date? (which in W7 is shown in the "Date" field).
    In other words: for every video file in my library, I want to take the date from the "Date" field and put it in the "Modified Date" field
    Thanks for your help.

    OK thanks.
    I've found a utility that modifes several of the date fields.
    Now, I just want to be sure that I don't screw this up...
    Which of the several date fields of a file holds the actual shot date?
    Which of the date fields is used by the organizer to "organize" the video files (avi and mov's) chronologically?
    Thanks for your help

  • IDoc posted in R/3 but data for Date field has not generated.

    Hi Experts
    This is JDBC to IDoc scenarion.
    Source: MS SQL Server
    Date Data Type: smalldatetime
    Date field Format: yyyy-MM-dd hh:mm:ss --> example: 2009-11-13 00:00:00
    XI Mapping: Source Date --> Transformation --> Target Date
    Transformation: yyyy-MM-dd hh:mm:ss to yyyyMMdd
    Target: R/3 System
    Date Data Type:  ERDAT from VBAK table - Date on Which Record Was Created
    Date field Format: Date field (YYYYMMDD) stored as char(8)
    Check points:
    1. Mapping is working fine in XI and transformation is done with the test data: 2009-11-13 00:00:00  --> to ---> 20091113
    2. In SXMB_MONI the data is processed from the source and the IDoc XML data is generated. In the IDoc XML data the date field is containing the value <DATE>20091113</DATE>
    3. But when I tried to open the IDoc(SE05) in R/3 the date field is empty and no data is generated.
    Request you to let me know why the error is happening.
    Regards
    Ram

    Hi Ram,
    First try to test the same IDOC generated in ECC Box by populating date field value using WE19 and test .
    Or
    Instead of passing date value from SQL Server, Just give a try with  Current Date function in Mapping and test in ECC system.
    then we can think on further analysis.
    Regards,
    Vijay

  • Idoc- File scenario: Read a data field in IDOC and name the file with it

    Hi All,
    I am configuring an IDOC to File scenario.
    I have a requirement where I need to read one of the IDOC data field and use that as the name of the File.
    E.g: If the IDOC data field-1 = '123456', then I need to name the output file as '123456'.
    Is it possible to do this. Appreciate your help on same.
    Thanks
    Shirin

    Try this code..
    desired field from IDoc will be input parameter to UDF
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    conf.put(key,a);  // a is input parameter
    String ourSourceFileName = conf.get(key);
    return  ourSourceFileName; 
    Also, check Adapter specific message attributes in file adapter, check  filename

  • Auto populate date field

    I have a JavaScript that I use to auto populate date fields. However, I've discovered that it doesn't work when the form is opened on an iPhone or Android phone. Is there a way to auto-populate a date field without using JavaScript?

    What app on the iPad are you using.
    Different apps on mobile devices have varying degrees of JavaScript compatibility.

  • Querying by date field parts: month, year

    Hi,
    is there ability in JDOQL to get month or year of date field and use them in
    filter? Example:
    search(Payment.class, "processDate.ext:getYear() == (select
    c.createDate.ext:getYear() from Client c where clientID == c.ID)");
    thanks,
    Povilas

    is there ability in JDOQL to get month or year of date field and use them in
    filter? Example:
    search(Payment.class, "processDate.ext:getYear() == (select
    c.createDate.ext:getYear() from Client c where clientID == c.ID)");Unfortunately, there is not. As your example indicates, however, you could code
    a custom query extension in Kodo to extract the year from a date in SQL.

  • In Pages, how to insert a PRINT-DATE field into a doc.?

    Want to insert a field that will show the date of the doc's printing. 
    In MS Word, this is known as 'insert print date'.
    How to do so in Pages?  Thanks.

    You can define placeholder text in Pages v5.5.2 in any of the six header/footer sections. Think of it as a a field code that when you click on it the text you enter replaces the placeholder text using the same style. By example, I placed a combination of text and placeholder text in the lower left footer segment.
    The text and the brackets were selected, and then Format ▸ Advanced ▸ Define as Placeholder Text. Also, because it is in the footer, it is replicated throughout the document. Although you could Insert > Date/Time into this placeholder text, automation may be preferred. I have chosen to use the same date/time style as MS Word uses in its print date field code. You can only change placeholder text programmatically with Pages and AppleScript on Yosemite. Once I run the AppleScript, all placeholder tags are replaced as shown in this image:
    You could make this an Automator Service (e.g. run AppleScript action with no input, and output replacement is checked). One could assign a keyboard shortcut to this service too. One click printed date stamp and document sent to default printer.
    The AppleScript (Yosemite only).
    property tagStr : "[print-date]"
    --- used for testing ---
    -- set f to POSIX path of ((path to desktop) as text) & "arg.pages"
    -- set hf to POSIX file f as alias
    set printDate to "" as text
    set theTags to {}
    tell application "Pages"
          activate
          -- open hf
          tell front document
               set theTags to the tag of every placeholder text whose tag is equal to tagStr
               -- Word print-date field code uses this 12-hour date/time format as mm/dd/YY 00:00 AM/PM
               set printDate to do shell script ("/bin/date +'%D %l:%M %p'") as text
               repeat with i from 1 to count of theseTags
                     set thisTag to item i of theseTags
                     set (every placeholder text whose tag is thisTag) to printDate
               end repeat
               -- use your own System Preferences printer name string
               tell application "Samsung ML-2950 Series (Sammy)"
               activate
               -- no print dialog
                    print front document without «class pdlg»
                    quit
               end tell
          end tell
          -- close front document saving no
    end tell

  • OIM Date field

    Hi,
    In my application there is a field 'Effective Date and time of transfer'. For that i have created the field in design console as date field . The date field is using the zapatec calendar in the custom UI code. I modified one of its property in javascript to show time also. Now it is showing time and am able to select time also along with date for that field in that app. But after submitting the request when i click on view it is showing only the date. It is not taking the time selected while storing it. Please let me know what may be the problem in this case. Thanks in advance.
    Regards,
    Durgaprasad

    I checked the action/bean class and there was a problem with format they are using to parse the date .They were converting to yyyy-mm-dd. Now i have changed the format to include time also and it is working properly. I queried the table using toad and i was able to find the entry in the table with time also. My resource object was Userdata and table name which i queried was UD_O_USERDATA. I was able to find the entry for the particular field with time and also confirmed that the entry was corresponding to the particular object instance key.
    Now after submitting the request when the user clicks on 'view', the data is taken from OIM using THOR API method getObjectFormData (FormInstanceOperationsintf).
    At this time am finding only the date when i inspect the resultset. It is truncating the time. What may the possible reason? Thanks in advance.
    Regards,
    Durgaprasad

  • Data Encryption using DBMS_OBSFUCATION_PACKAGE

    Hello Friends,
    I want to encrypt EMPNAME column data in EMP table using
    DBMS_OBSFUCATION_PACKAGE. I am not getting much help for this
    package. can anybody suggest me some sites concerning
    information on package ?
    Thanx.
    Adi

    try this one.
    I am pasting the procedure.
    run catobtk.sql from sys
    DECLARE
    input_string VARCHAR2(16) := 'SRINIVAS';
    raw_input RAW(128) := sys.UTL_RAW.CAST_TO_RAW(input_string);
    #key_string VARCHAR2(16) := 'keepthesecretnum';
    key_string VARCHAR2(16) := 'abcdefghijklmnop';
    raw_key RAW(128) := sys.UTL_RAW.CAST_TO_RAW(key_string);
    encrypted_raw RAW(2048);
    encrypted_string VARCHAR2(2048);
    decrypted_raw RAW(2048);
    decrypted_string VARCHAR2(2048);
    error_in_input_buffer_length EXCEPTION;
    PRAGMA EXCEPTION_INIT(error_in_input_buffer_length, -28232);
    INPUT_BUFFER_LENGTH_ERR_MSG VARCHAR2(100) :=
    '*** DES INPUT BUFFER NOT A MULTIPLE OF 8 BYTES - IGNORING
    EXCEPTION ***';
    double_encrypt_not_permitted EXCEPTION;
    PRAGMA EXCEPTION_INIT(double_encrypt_not_permitted, -28233);
    DOUBLE_ENCRYPTION_ERR_MSG VARCHAR2(100) :=
    '*** CANNOT DOUBLE ENCRYPT DATA - IGNORING EXCEPTION ***';
    -- 1. Begin testing raw data encryption and decryption
    BEGIN
    dbms_output.put_line('> ========= BEGIN TEST RAW DATA
    =========');
    dbms_output.put_line('> Raw input : ' ||
    sys.UTL_RAW.CAST_TO_VARCHAR2(raw_input));
    BEGIN
    sys.dbms_obfuscation_toolkit.DESEncrypt(input => raw_input,
    key => raw_key, encrypted_data => encrypted_raw );
    sys.dbms_output.put_line('> encrypted hex value : ' ||
    rawtohex(encrypted_raw));
    sys.dbms_obfuscation_toolkit.DESDecrypt(input => encrypted_raw,
    key => raw_key, decrypted_data => decrypted_raw);
    dbms_output.put_line('> Decrypted raw output : ' ||
    sys.UTL_RAW.CAST_TO_VARCHAR2(decrypted_raw));
    dbms_output.put_line('> ');
    if sys.UTL_RAW.CAST_TO_VARCHAR2(raw_input) =
    sys.UTL_RAW.CAST_TO_VARCHAR2(decrypted_raw) THEN
    dbms_output.put_line('> Raw DES Encyption and Decryption
    successful');
    END if;
    EXCEPTION
    WHEN error_in_input_buffer_length THEN
    dbms_output.put_line('> ' || INPUT_BUFFER_LENGTH_ERR_MSG);
    END;
    dbms_output.put_line('> ');
    END;

  • How can I encrypt/decrypt data in Forms using a specified Package?

    Hi All,
    I have searched in the Internet for ecnrypting/decrypting data in Forms.
    That is when I want to query the data outside the Form Application it will be encypted, otherwise if I want to query it in the form application it will be dycrypted
    I found this package:
    CREATE OR REPLACE PACKAGE Encrypt_pkg AS
    FUNCTION encrypt (p_text IN VARCHAR2) RETURN RAW;
    FUNCTION decrypt (p_raw IN RAW) RETURN VARCHAR2;
    END Encrypt_pkg;
    CREATE OR REPLACE PACKAGE BODY Encrypt_pkg AS
    -- All VARCHAR2 inputs are padded to multiples of 8 charaters,
    -- with the encryption key also being a multiple of 8 charaters.
    -- The encryption key and padding characters can be altered to suit.
    g_key RAW(32767) := UTL_RAW.cast_to_raw('12345678');
    g_pad_chr VARCHAR2(1) := '';
    PROCEDURE padstring (p_text IN OUT VARCHAR2);
    FUNCTION encrypt (p_text IN VARCHAR2) RETURN RAW IS
    l_text VARCHAR2(32767) := p_text;
    l_encrypted RAW(32767);
    BEGIN
    padstring(l_text);
    DBMS_OBFUSCATION_TOOLKIT.desencrypt(input => UTL_RAW.cast_to_raw(l_text),
    key => g_key,
    encrypted_data => l_encrypted);
    RETURN l_encrypted;
    END;
    FUNCTION decrypt (p_raw IN RAW) RETURN VARCHAR2 IS
    l_decrypted VARCHAR2(32767);
    BEGIN
    DBMS_OBFUSCATION_TOOLKIT.desdecrypt(input => p_raw,
    key => g_key,
    decrypted_data => l_decrypted);
    RETURN RTrim(UTL_RAW.cast_to_varchar2(l_decrypted), g_pad_chr);
    END;
    PROCEDURE padstring (p_text IN OUT VARCHAR2) IS
    l_units NUMBER;
    BEGIN
    IF LENGTH(p_text) MOD 8 > 0 THEN
    l_units := TRUNC(LENGTH(p_text)/8) + 1;
    p_text := RPAD(p_text, l_units * 8, g_pad_chr);
    END IF;
    END;
    END Encrypt_pkg;
    ** Now How can I use this package to encrypt/decrypt data in the form as I said Plz???

    <p>Read this article and go to chapter 2.3.2.</p>Inserts, Update and Delete orders are managed by a stored procedure. In the sample dialog, the Select is handled by the emp_pkg.emp_query() stored function:
      PROCEDURE emp_query(emp_data IN OUT emptab) IS
        ii NUMBER;
        CURSOR empselect IS
          SELECT empno, ename, job, sal, comm FROM emp
           ORDER BY ename ;
      BEGIN
        OPEN empselect;
        ii := 1;
        LOOP
          FETCH empselect INTO
            emp_data( ii ).empno,
            emp_data( ii ).ename,
            emp_data( ii ).job,
            emp_data( ii ).sal,
            emp_data( ii ).comm;
          EXIT WHEN empselect%NOTFOUND;
          ii := ii + 1;
        END LOOP;
      END emp_query;In your case, all you have to do is th use your decrypt() function in the cursor definition:
        CURSOR empselect IS
          SELECT decrypt(empno), decrypt(ename), decrypt(job), decrypt(sal), comm FROM emp
           ORDER BY ename ;
    ...For Insert and Update events, use the crypt() function in the related stored procedures.
      PROCEDURE emp_insert2(t IN emptab) IS
      BEGIN
        FOR i IN t.first..t.last LOOP
         INSERT INTO emp (empno, ename, job, sal, comm)
         VALUES(crypt(t(i).empno), crypt(t(i).ename), crypt(t(i).job), crypt(t(i).sal, t(i).comm));
         END LOOP ;
      END emp_insert2;Idem for the Update procedure.
    Francois

  • Error While using date fields in HIbernate Criteraia

    I am trying a sample applciation using Hibernate with JPA. I am using annotations to map database table with Java class.I am using org.hibernate.Criteria to form where clause. My code looks as follows:
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("PERSISTANCE_UNIT");
    EntityManger em = emf.createEntityManager();
    Session session = em.getDelegate();
    Criteria criteria = session.createCriteria(MyDO.class)
    criteria.add(Restrictions.eq("myDO.date",myDO.getDate()));
    List list = criteria.list();
    I am searching the data base based on the date field (myDO is an instance of MyDO.class which contains the mapping to the data base table). While running the application first time after publishing to server, I am getting the following error. For subsequent running of the application I am not getting any error and the appliaction was running with actual results.
    JDBCException W org.hibernate.util.JDBCExceptionReporter logExceptions SQL Error: -181, SQLState: 22007
    JDBCException E org.hibernate.util.JDBCExceptionReporter logExceptions THE STRING REPRESENTATION OF A DATETIME VALUE IS NOT A VALID DATETIME VALUE
    org.hibernate.exception.DataException: could not execute query
         at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:77)
         at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
         at org.hibernate.loader.Loader.doList(Loader.java:2223)
         at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
         at org.hibernate.loader.Loader.list(Loader.java:2099)
         at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
         at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
         at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
    Can anybody help in fixing the problem.
    Thanks in advance.

    Resolved the issue by setting System date where expected

  • Sorting of Date field in the SQL Query useing ORDER BY

    Hi
    I am facing a problem when I am getting the results of a query from the ORacle 8i database using jdbc connection.
    The query is having a date field and I have to sort the query results using ORDER By for the Date field. The query is giving exact results in the SQL PLus interface.
    When I am getting this results in the GUI where servlets are being used an Exception is coming as not supported RefreshRow method.
    If anyone has faced this problem and have got the solutions please let me know.
    thanks
    sulfy

    That doesn't sound at all like an SQL problem.
    More like you trying to do updates on the resultset which is not allowed ...
    send a some code (not to much pls :) and we'll be
    able to help more
    cu
    Spieler

  • How do I apply filters or limit the rows on my report using a Date field in SQL report builder 3.0?

    I have a status of completed and a date field in the dataset. The date field is either empty or contains a date. All 2015 dates are holding dates.
    So how can I limit the report to only pull completed status with an empty date or a holding date?
    I have not been able to set an OR option on a date field filter and if I add two filters on the date column one for empty one for > 12/31/2014 then it treats it as an "and" and pulls nothing from the list I have in sharepoint.
    any help will be appreciated.

    Hi MB,
    In Reporting Services, the relationship of  filters is “And”, and there is no option to change the relationship from “And” to “Or”. While we can use “or” operator within the expression to create one filter to integrated all filters to work around this
    issue.
    We can add a filter as follows in the dataset to limit the rows in your report:
    Expression: =Fields!date.Value is nothing or Fields!date.Value>"12/31/2014"    Type: Boolean
    Operator: =
    Value: true
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    If you have any feedback on our support, please click
    here.
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for