Solved

XOR Encryption (Decryption) using SSRS

Posted on 2009-05-19
3
912 Views
Last Modified: 2012-05-07
I am using XOR encryption to encrypt a value.  I want the value to show up in a SSRS report, how do I decrypt it using SSRS (Sql Server Reporting Services)?  Below is the code for encryption
Public Shared Function XOREncryption(ByVal key As String, ByVal value As String) As String

            Dim intXORValue1 As Integer

            Dim intXORValue2 As Integer

            Dim strDataOut As String = ""
 

            For lonDataPtr As Long = 0 To (value.Length - 1)

                intXORValue1 = Asc(value.Substring(lonDataPtr, 1))

                intXORValue2 = Asc(key.Substring(lonDataPtr Mod key.Length, 1))

                If (intXORValue1 = intXORValue2) Then

                    strDataOut &= Chr(intXORValue2)

                Else

                    strDataOut &= Chr(intXORValue1 Xor intXORValue2)

                End If

            Next lonDataPtr
 

            Return strDataOut

        End Function

Open in new window

0
Comment
Question by:Perfect10Sat
  • 2
3 Comments
 
LVL 9

Expert Comment

by:VikramMullick
Comment Utility
0
 

Author Comment

by:Perfect10Sat
Comment Utility
None of these answer my question, they just say how to do XOREncryption which I already have completed with the attached code..  I need to know how to do it in a SQL Reporting Service report..
0
 

Accepted Solution

by:
Perfect10Sat earned 0 total points
Comment Utility
Figured it out, put the code above from me in the "Report Properties", Tab "Code".

Then call it like the following..

="Field decrypted is: "+code.XOREncryption("Key",Fields!DbField.Value)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

How to use Variables  and Custom code in SSRS report and Assembly reference to use compile shared code in SSRS. Its big question for all who are working with SSRS. It is easy to create assembly and refer in SSRS report, still there are some steps…
A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 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

16 Experts available now in Live!

Get 1:1 Help Now