help needed to write a oracle function that can do this...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pat

    help needed to write a oracle function that can do this...

    Encrypt function:

    - One parameter is passed to it, defined as a string, and its called
    strCryptThis
    - set the encryption key (g_key) = "ISSUETRK"
    - for each character in strCryptThis, have a counter ( =1 ) going and
    do the following:
    - take the ASCII value of the letter that the counter equals to in
    g_key. assign this to the variable iKeyChar
    ex: if counter=1 then take the ascii value of "I", if
    counter=2, then take the ascii value of "S" and so on
    - do the same as above except now do it for strCryptThis. assign it to
    iStringChar
    - take iKeyChar and XOR it with iStringChar and assign it to
    iCryptChar
    - take the charactorCode equivalent of iCryptChar and reassign it back
    to iCryptChar
    - take the ASCII equivalent of iCryptChar and reassign it back to
    iCryptChar
    here you should now have a number (still in a string format though).
    - if iCryptChar is less than 10 then pad two zeros to the beginning of
    it
    ex: if iCryptChar is 6 then iCryptChar = "006"
    - if iCryptChar is less than 100, then pad one zero to the beginning
    of it
    ex: if iCryptChar is 74 then iCryptChar = "074"
    - concatenate this value to a variable strEncrypted
    - increment the counter and repeat above steps for each charactor of
    strCryptThis

    - return strEncrypted

    thanks Pat
  • Guido Konsolke

    #2
    Re: help needed to write a oracle function that can do this...

    Hi Pat,

    would you mind telling us how far you got?
    What have you tried?
    Have you read about the provided functions in your manuals?

    Show us that you've put in some effort. Then ask about
    the errors you get or the parts that still are unsolved.

    Sorry, no help right now.

    Guido


    Comment

    • Mark D Powell

      #3
      Re: help needed to write a oracle function that can do this...

      "Guido Konsolke" <GK@oblivion.co mwrote in message news:<107112847 6.118654@news.t hyssen.com>...
      Hi Pat,
      >
      would you mind telling us how far you got?
      What have you tried?
      Have you read about the provided functions in your manuals?
      >
      Show us that you've put in some effort. Then ask about
      the errors you get or the parts that still are unsolved.
      >
      Sorry, no help right now.
      >
      Guido
      Would the Oracle provided package: DBMS_OBFUSCATIO N_TOOLKIT that
      performs encryption and decryption meet the underlying need here. See
      the Oracle Supplied Packages manual.

      HTH -- Mark D Powell --

      Comment

      Working...