<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'Problem with encryption' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'Problem with encryption' posted on the 'Pascal' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2012 Programmers Heaven</copyright>
    <pubDate>Wed, 23 May 2012 22:39:36 -0700</pubDate>
    <lastBuildDate>Wed, 23 May 2012 22:39:36 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Problem with encryption</title>
      <link>http://www.programmersheaven.com/mb/pasprog/409929/409929/problem-with-encryption/</link>
      <description>I am new to pascal.I need to make a program that read a whole text and a line of letters which will replace the alphabet.My problem is that i don't know how to read the text and keep every single letter.&lt;br /&gt;
&lt;br /&gt;
while not eoln do&lt;br /&gt;
begin&lt;br /&gt;
read(x);&lt;br /&gt;
k:=k+1;&lt;br /&gt;
aba[k]:=x&lt;br /&gt;
end;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
this is what i use.aba is where i place the letters. it does'nt start and it says:command terminated by signal 24&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/409929/409929/problem-with-encryption/</guid>
      <pubDate>Fri, 27 Nov 2009 06:42:40 -0700</pubDate>
      <category>Pascal</category>
    </item>
    <item>
      <title>Re: Problem with encryption</title>
      <link>http://www.programmersheaven.com/mb/pasprog/409929/410151/re-problem-with-encryption/#410151</link>
      <description>Here's a simple single file encryption/decryption program using a simple xor encryption method. The beauty of this is that the same code does the job both ways.&lt;pre class="sourcecode"&gt;&lt;span style="color: Blue;"&gt;{ Compiler TP/BP7 }

{$A+,B-,D-,E-,F-,G+,I-,L-,N+,O-,P-,Q-,R-,S-,T-,V-,X+}
{$M 16384,0,655360}

var f_in,f_out:file;                { Files as untyped                }
    f_in_name,f_out_name,pwd:string;{ File names                      }
    pwd_value,bytes_read:word;      { Password checksum, read counter }
    i:word;                         { Counter                         }
    buffer:array[0..16383] of byte; { 16 kByte buffer for data        }

begin
 pwd_value:=0;                      { Init password checksum with 0   }
 write('Enter filename to encrypt/decrypt: ');readln(f_in_name);
 write('Enter filename to decrypt/encrypt: ');readln(f_out_name);
 write('Enter password: ');readln(pwd);
 for i:=1 to length(pwd) do begin { Calculate BSD checksum of the password  }
  pwd_value:=(pwd_value shr 1) + ((pwd_value and 1) shl 15); { Parity bit   }
  inc(pwd_value,ord(pwd[i]));     { Increment password checksum             }
  pwd_value:=pwd_value and $ffff; { Keep it whitin bounds                   }
 end;
 randseed:=pwd_value;             { Init random seed with password checksum }
 assign(f_in,f_in_name);reset(f_in,1); { Open input file for read           }
 if ioresult&amp;lt;&amp;gt;0 then begin        { Check if input file exists              }
  writeln(f_in_name,' not found, exiting.');
  halt;
 end;
 assign(f_out,f_out_name);rewrite(f_out,1);{ Create output file             }
 while not(eof(f_in)) do begin
  blockread(f_in,buffer,16384,bytes_read); { Read a chunk for input file    }
  for i:=1 to bytes_read do               { Encrypt or Decrypt (Same thing) }
   buffer[i]:=buffer[i] xor byte(random(256));{ Simple XOR encryption       }
  blockwrite(f_out,buffer,bytes_read);   { Output encrypted/decrypted data  }
 end;
 close(f_in);close(f_out);               { Close both files                 }
end.&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/pasprog/409929/410151/re-problem-with-encryption/#410151</guid>
      <pubDate>Tue, 01 Dec 2009 23:50:35 -0700</pubDate>
      <category>Pascal</category>
    </item>
  </channel>
</rss>
