in reply to Reversible per-line "encryption"
Of course you/they would have to create different translations for each different group (perhaps trade digits with chars and uc with lc, etc.), and then provide the reverse translation to that group.#!/usr/bin/perl -w use strict; ## their side before sending the file to you... my $line = "ABC|John Smith 1234"; my ($groupID, $text) = split(/\|/, $line, 2); $text =~ tr/a-z/f-za-e/; $text =~ tr/A-Z/I-ZA-H/; $text =~ tr/0-9/4-90-3/; $line = $groupID . "\|" . $text; print "$line\n"; ## And then on your end... my $myGroup = "ABC"; my ($group, $data) = split(/\|/, $line, 2); if($group eq $myGroup) { $data =~ tr/f-za-e/a-z/; $data =~ tr/I-ZA-H/A-Z/; $data =~ tr/4-90-3/0-9/; } print "$data\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Reversible per-line "encryption"
by bmcatt (Friar) on Jan 26, 2002 at 01:04 UTC | |
by xtype (Deacon) on Jan 26, 2002 at 01:38 UTC |