Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Encrypt a Field 2

Status
Not open for further replies.

JonathanNYC

IS-IT--Management
Mar 29, 2003
111
US
My report has patient name in it. I wish to retain the printing of the patient name in the report but encrypt it to prevent someone viewing the report from determining true identity of the patient. I know how to suprress the field from printing (but I don't want to do that). Is there some relatively easy formula I might use to change the characters so that it disguises the true identity of the patient. I am using Crystal 8.0. One option I have considered is to use, say, last three letters of the first and last name to print. For example, Jonathan Livingston display as Han Ton - not very elegant. Another solution, please?
 
Is there not another suitable field that might be better used to identify patient to someone who ought have access without revealing name? A unique {patient.id} or similar?

I'm confused as to why you 'must' show the field but must also hide it...

I'm assuming that the report is intended solely for certain persons viewing yet you don;t want anyone else to pick up the report and know whom it refers to?

If that is the case then there really are limitless ways you could get around this - I would suggest that the most effective would not be to do a basic form of encryption as you describe.

Find another more suitable way to identify the patient that only those who are (or should be) viewing the report will be able to understand.

Any form of character replacement / anagram of the name is too easily broken.

J
 
For a quasi-encryped effect, you could simply use wingdings as the font...

Cheers,
- Ido

Visual CUT & DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Dear Jonathan,

From the Crystal help look up For Loop Example. There is an example of a For Loop using the Ceasar Ciper:

//The Caesar cipher

//The input string to encrypt
Local StringVar inString := {Customer.Customer Name};
Local NumberVar shift := 5;
Local StringVar outString := "";
Local NumberVar i;
For i := 1 To Length(inString) Do
(
Local StringVar inC := inString ;
Local StringVar outC;
Local BooleanVar isChar :=
LowerCase(inC) In "a" To "z";
Local BooleanVar isUCaseChar :=
isChar And (UpperCase (inC) = inC);

inC := LCase(inC);

If isChar Then
(
Local NumberVar offset :=
(Asc(inC) + shift - Asc("a")) Mod
(Asc("z") - Asc("a") + 1);
outC := Chr(offset + Asc("a"));
If isUCaseChar Then outC := UpperCase(outC)
)
Else
outC := inC;
outString := outString + outC
);
outString

So that "Rosemary Lieberman" becomes WTXJRFWD QNJGJWRFS

I hope that helps. Not many would suspect a Ceasar cipher was in place.....

regards,

ro

Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Excellent suggestions, one and all. Wow! Thank you much.
 
Dear Ido,

The only worry I have of using Wingdings is that you can copy text from a report while viewing, paste it into notepad (or right here) and tada ... no encryption..

best regards,

ro



Rosemary Lieberman
rosemary-at-microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.

You will get answers more quickly if you read this before posting: faq149-3762
 
Hi,
I share CR85user's confusion on this point:

I'm confused as to why you 'must' show the field but must also hide it...


If you want it hidden why print it ( or even include it in the report)



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Why not just overlay it with another field that says this data is encrypted...

But I 3rd turk's second, sounds like lunacy unless you are conditionally encrypting.

You might also use a SQL Expression to do this, and conditionally return data in that instance, offloading the processing to the database.

Turk: Either we didn't get much of the story, which is likely here, or they're just posing a hypothetical situation, I can see no business need for this other than the aforementioned.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top