Solved

Encryption !!

Posted on 2002-04-27
14
315 Views
Last Modified: 2012-08-13
hi all,

i have one table in which some of the columns are encrypted. In the name column we have a value like this àóõüö¶åùûýÿ which stands for Prabha Nagarajan and àóõüö¶ê þýÿ for Prabha Sridharan.

Can anyone help me out in this issue. I would like to know the algorithm which is used for this encryption. Help me out

thanks

bharat
0
Comment
Question by:catchbharat
  • 5
  • 3
  • 3
  • +3
14 Comments
 
LVL 1

Expert Comment

by:asafmm
ID: 6974417
catchbharat

I don't think it is Encryption !!!

If you are using SQL server that it maight be colation issue.

The server keep the data in different colations (there is a server default but you can change it for any object : DB, table, etc..)

Try to use the folowing TSQL (you can run it in the Quey Analayser)
ALTER DATABASE <DBname>
COLLATE  <ColationName>

I used ColationName = SQL_Latin1_General_Cp1255_CI_AS in one case like yours.

Take a look on :

http://msdn.microsoft.com/library/en-us/architec/8_ar_da_6ttf.asp?frame=true
Will explain all you need on collations

http://msdn.microsoft.com/library/en-us/instsql/in_collation_6gfn.asp?frame=true
Show basic window collations

Thanks
Asaf
0
 
LVL 22

Expert Comment

by:CJ_S
ID: 6974629
If it is encrypted (which I am not sure of) you might want to look into the encrypt api.

CJ
0
 
LVL 1

Expert Comment

by:gron
ID: 6974775
If this is a private application it may well be encrypted with a simple programming technique using the XOR operator.
In this method, the "message" (in your case the name) is XOR'ed against a fixed "mask" or "code" which might be embedded in the program code. This could be a character string, or even a one-time computer generated random string. So there are 3 elements, the message, the mask, and the encrypted message. With any 2 of the elements, you can decode the third. In your 2 examples, applying XOR yields the two "masks" below, shown in 3-digit ascii character codes:

176118146151148151150171152102154124156098158096
176118146151148151150185082106154108156098158096
                      ______________

They should both be identical, but they are not in the underlined section. This could be explained by errors in your posted message, eg. printing non-printable characters. To be exact, I would require the ascii code sequences for your ecrypted column. More examples would also help. But based on the above, it looks like basix XOR encryption to me.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 1

Expert Comment

by:gron
ID: 6974777
Please note, in my prior message, the underlining did not appear where it was intended, further down the line
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6975047
I don't suppose we can see any movement in your many open questions?  For the record:

Questions Asked 5
Last 10 Grades Given A  
Question Grading Record 1 Answers Graded / 1 Answers Received

In case you so feel inclined, here is the list of your open questions:
Writing on to a CD -RW from Mac OS 8.6 Directly , is it possible ? Date: 11/21/2001 03:23AM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=macintosh&qid=20238360
A simple query !! Date: 12/11/2001 11:00PM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20245506
How to get rid of the startup programs ?? Date: 04/16/2002 06:21AM PST
http://www.experts-exchange.com/jsp/qShow.jsp?ta=winxp&qid=20290025

Anthony
0
 
LVL 18

Expert Comment

by:mdougan
ID: 6977567
catchbharat, please close out your open questions... thanks!

Private Sub Command1_Click()
Dim sTemp As String
    sTemp = Encrypt("Prabha Nagarajan", True)
    MsgBox sTemp
    sTemp = Encrypt(sTemp, False)
    MsgBox sTemp

    sTemp = Encrypt("Prabha Sridharan", True)
    MsgBox sTemp
    sTemp = Encrypt(sTemp, False)
    MsgBox sTemp

End Sub

Private Function Encrypt(sSource As String, bEncrypt As Boolean) As String
Dim i As Long
Dim sTemp As String
Dim lTemp As Long

If bEncrypt Then
    For i = 0 To (Len(sSource) - 1)
        lTemp = Asc(Mid(sSource, i + 1, 1)) + (144 + i)
        If lTemp > 255 Then
            lTemp = lTemp - 255
        ElseIf lTemp < 0 Then
            lTemp = 255 + lTemp
        End If
        sTemp = sTemp & Chr(lTemp)
    Next i
Else
    For i = 0 To (Len(sSource) - 1)
        lTemp = Asc(Mid(sSource, i + 1, 1)) - (144 + i)
        If lTemp > 255 Then
            lTemp = lTemp - 255
        ElseIf lTemp < 0 Then
            lTemp = 255 + lTemp
        End If
       
        sTemp = sTemp & Chr(lTemp)
    Next i
End If

    Encrypt = sTemp
End Function
0
 
LVL 1

Expert Comment

by:gron
ID: 6977757
mdougan:
Very nice ! A simple offset.
0
 
LVL 18

Expert Comment

by:mdougan
ID: 6977836
really simple
0
 
LVL 18

Accepted Solution

by:
mdougan earned 300 total points
ID: 6984181
Any feedback catchbharat?
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6984209
mdougan,

I would not hold your breath.  catchbharat's current record:

Questions Asked 5
Last 10 Grades Given A A  
Question Grading Record 2 Answers Graded / 2 Answers Received

Anthony
0
 
LVL 18

Expert Comment

by:mdougan
ID: 6984805
Oh, I'm not holding my breath, but I figure if they get enough e-mail notifications, they might try to do something about it.  Community Support has been pretty good about getting people to clean up their outstanding questions lately too.
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 6984998
I agree completely with you.  Perhaps one more email notification will do the trick. Don't you agree? <g>

Anthony
0
 

Author Comment

by:catchbharat
ID: 6985857
Thanks dougan as everyone suggested i have closed out all the questions. once again thanks a lot !!

bharat
0
 
LVL 18

Expert Comment

by:mdougan
ID: 6987519
You're welcome, and thanks for clearing out out backlog :)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
vb6 connector to SQL Server 2 37
Copy a row 12 62
IF ELSE Statement in Excel Macro VBA 16 75
VBA: Insert New column with specific format type 12 38
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

766 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question