Site Wide Message: (current site time 9/9/2010 3:00:07 AM EDT)
  • We want your input! One of our sponsors wants to know your opinion about development related issues. Click here to tell us what you think.
  • Are you an emerging/young developer (aged 18-30)? If so, would you like the chance to affect future developer tools and products?
    If so, then click here to give your feedback.
 
Third Party Product Review:
Reviews are a new feature of Planet Source Code that allow site visitors to share their experiences on commercial third party products in real life situations.

Oracle Password Decrypt

Print
Email
article
Submitted on: 1/26/2004 6:47:54 AM
By: quasi_nut_royce  
Level: Beginner
User Rating: Unrated
Compatibility:Oracle

Users have accessed this review  34689 times.
 
author picture
(About the author)
 
     You can use this algo to manually create the encrypted password generated by the Oracle Mapping Work Bench. This can also be used of course with a little work to Decrypt the password stored in the xml file.

 
 
Terms of Agreement:   
By using this review, you agree to the following terms...   
  1. You may use any of the code in this review in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this review (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this review from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the review or review's description.
				

constants:

even indexed characters = 4

odd indexed characters = 112

append string=A7FCAA504BA7E4FC

 

Even rule:

ascii value of the current character (plus) + 4, (minus) - "position of the current character".

 

Odd rule

ascii value of the current character (plus) + 112, we then add the result of the expression : "position of the current character " - 1. divide the result by 2.

                                                                                                                                        then multiply the result by 6.

 

Algorithm:

for each character of the password string say for example "password", apply the rule depending on whether the index of the character of the password string is odd or even.

 

Example.

first character is "p" which has the even index so we apply the "even rule."

ascii value of "p" is 112. we add 4 minus 0, we get 116.  Then we convert this into HEX which is equivalent to "74"

 

 second character is "a" and it has an odd index.

ascii value is 97. 97 plus the 112 = 224. postion of the current character is 1. so we subtract 1 we get 0. we divide 0 by 2 and we still get 0. then we multiply the result by 6 and still get 0 there fore nothing is added to  224.  Then we convert this into HEX which is equivalent to "E0".  Then we append this to our

previous result for the previous character which is "74" to get "74E0".

do this process for the rest of the characters of the password. then append the string "A7FCAA504BA7E4FC"

there we have the encryption process used by Oracle Toplink Mapping WorkBench.

 

Sample Code:

private String encodePassword(String password) {
String retVal="";
char c;
int num=0;

for (int i=0;i<password.length();i++) {
c=password.charAt(i);
num = (int)c;
System.out.println ("char="+c+" num="+num);
if (i%2==0) {
retVal = retVal+Integer.toHexString(num + 4 - i) + "";
} else {
retVal = retVal+Integer.toHexString(num + 112 - (((i - 1) / 2) * 6)) + "";
}
}
retVal = retVal.toUpperCase();
retVal = retVal+"A7FCAA504BA7E4FC";
return retVal;
}

 
 Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:
 
Your Vote!

What do you think of this review(in the Beginner category)?
(The review with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
2/28/2004 4:15:32 PM

ho! ho!
second character is "a" and it has an odd index.
ascii value is 97.
97 plus the 112 = 224.
EREUR 97 + 112 = 209

(If this comment was disrespectful, please report it.)

 
2/28/2004 4:17:32 PM

--code in vb--
Function encodePassword(password As String) As String
' ? encodePassword("password") >> 74D175DD77D370C2 A7FCAA504BA7E4FC
Dim retVal As String
Dim c As String
Dim num As integer, i As integer
retVal = ""
c = ""
num = 0
i = 0
For i = 1 To Len(password)
c = Mid(password, i, 1)
num = Asc(c)
Debug.Print "char= "; c, " num= "; num
If Int(i / 2) = i / 2 Then ' Even rule Pair
'règle pour les rangs PAIR à compter de 0 (i-1)
retVal = retVal & Hex(num + 112 - (((i - 2) / 2) * 6)) & ""
Else ' Odd rule Impair
'règle pour les rangs IMPAIR à compter de 0 (i-1)
retVal = retVal & Hex(num + 4 - (i - 1)) & ""
End If
Next i
retVal = UCase(retVal)
retVal = retVal + "A7FCAA504BA7E4FC"
encodePassword = retVal
End Function
(If this comment was disrespectful, please report it.)

 
Add Your Feedback!

Note:Not only will your feedback be posted, but an email will be sent to the code's author from the email account you registered on the site, so you can correspond directly.

NOTICE: The author of this review has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular review, please click here.
 
To post feedback, first please login.