title: DES Encryption and Decryption in PHP
body: <p>Please help. How do I make an array in encrypt and decrypt?</p>
  
  <pre><code>&lt;?php
      class DES{
  
          function encrypt($plainText, $cipherKey){
              //plainText
              $result = $this-&gt;toBiner($plainText);
              $result = $this-&gt;InitialPermutation($result);
              //key
              $key = $this-&gt;toBiner($cipherKey);
              $key = $this-&gt;kompresBit($key);
              $arrLeftShift = $this-&gt;LeftShift($key);
              //final
              $result = $this-&gt;keyExpansion($result, $arrLeftShift);
              return $result;
          }
  
          function decrypt($encryptedText, $cipherKey){
              $key = $this-&gt;toBiner($cipherKey);
              $key = $this-&gt;kompresBit($key);
              $arrLeftShift = $this-&gt;LeftShift($key);
  
              $result = $this-&gt;reverseKeyExpansion($encryptedText, $arrLeftShift);
              $result = $this-&gt;revInitialPermutation($result);
  </code></pre>