Solved

Encryption !!

Posted on 2002-04-27
14
313 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

910 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now