my @textCharacters = split( // , $plainText );
for( $j = 0 ; $j <= ( length( $plainText )/8 )-1 ; $j++ )
{
$z = "";
for( $k = 0 ; $k <= 7; $k++ )
{
$i = $j*8 + $k;
$z .= $textCharacters[$i];
}
print "STRING";
print "Z = X $z X \n";
my $cipher = new Crypt::Blowfish $key;
$cryptText .= $cipher->encrypt( $z );
}
####
7Æ Mb¢[ñF%L;Á^ô¥ X
####
my @glyphs;
my $plainText = $_[0];
# Pad string to divisible by glyph choice
my $padLength;
if( length( $plainText ) % 3 ne "0" )
{
$padLength = 3 - ( length( $plainText ) % 3 );
}
$plainText .= " "x$padLength;
print " pad = $padLength , $plainText X\n";
# Convert text to ASCII
@asciiCodes = unpack( "c*", $plainText );
for( $j = 0 ; $j <= ( length( $plainText )/3 )-1 ; $j++ )
{
my $sum = 0;
for( $k = 0 ; $k <= 2 ; $k++ )
{
$i = ( $j*3 + $k );
$sum += @asciiCodes[$i] * ( 65536 ** ( 2-$k ) );
}
push( @glyphs , $sum );
}
return( @glyphs );