Category: Cryptography
Author/Contact Info Wombat
Description: I recognize that this is not a security group, but I figure there must be at least a few cypherpunks in the lot of you. I came up with this scheme for encrypting text, and submit it to you to see if anyone can come up with any obvious holes.

The way this works, is a user types a passphrase which gets turned into a number between 0 and the maximum size of an integer (4,294,967,924). This number then is used to seed the random number generator. The program then collects single numbers between 0 and 7 by repeatedly calling rand(), until it has a bit vector. Then for each character of input, it maps the characters bits to the bit vector producing a scrambled character which it prints to STDOUT. By entering the same passphrase again, you get the same srand seed and thus can decrypt your bits at a later date.

Features include:
Arbitrarily long passphrases: Type as much as you like, the seed won't mind.
Non-portability: (It's not a bug!) I realize that everyone has different random number generators. That's okay. I'm mostly using this to lock down my own personal secret files. I don't think the security would be compromised too much if a person sent the particulars of their random number generator along with cyphercode if they wanted a friend to get a message.
No way to decrypt the text: I haven't coded the decryptor yet, so as of now, once encrypted, things STAY encrypted! :-)

So yeah! Like, peer-review me and stuff! BTW: I do realize that this is "Weak security" at best, and probably can be defeated by brute force if so desired. I know. But BESIDES that... :-)

#!/usr/bin/perl -w
$key=0;        #Initialize variables. 
print "Enter passphrase: ";
chomp $phrase;
@letters = split //,$phrase;
foreach $CHAR (@letters) {  #Use phrase to create random seed
  $modulo = $newbits % 10;
  if ($updown == 0) {
    if ($key < 0){$key*=-1;}
    if ($key>4294967294){$updown=1;}
  if ($updown == 1) {
    if ($key<0){$updown=0;}
srand $key;
while(<STDIN>) {
 @inputchars = split //;
 foreach $CHAR (@inputchars){
 for (0..8) {      #Translate the input char into binary
  $t = $charnum % (2**$_);
  if($t==$oldt) {
  }else {$binarr[8-$_]=1;}
  while ($i<8) {   #Assemble the key bit vector.
    if ($arrdone[$randout]==0) {
  for(0..7) {      #Assemble the scrambled bit vector.
    if ($binarr[$_]==1) {
    $outchar[$shifter[$_]] = 1;
    else {$outchar[$shifter[$_]] =0;}
  for(0..7) {     #Rejoin the new bits to an ord
    if ($outchar[$_]==1) {
  $och= chr($sum);    #Print the char.
  print $och;
  $i=0;     #Reset variables