title: How do I convert Python encryption to PHP?
body: <p>In short, I want to login on my site and I want to login in encrypted form in php codes. I want to use Base64 and SHA256, SHA 256 for encryption.</p>
  
  <p>I would like to know if it is possible to convert this ciphertext into PHP language, I need to convert the generated passwords to be accepted on my site's login system, but I do not know how to do this.</p>
  
  <p>In Python I have a database with passwords generated with this encryption:</p>
  
  <blockquote>
    <p>base64.b64encode(hashlib.sha256(hashlib.sha256(password).hexdigest() + "\xf7\x1a\xa6\xde\x8f\x17v\xa8\x03\x9d2\xb8\xa1V\xb2\xa9>\xddC\x9d\xc5\xdd\xceV\xd3\xb7\xa4\x05J\r\x08\xb0").digest())</p>
  </blockquote>
  
  <p>PHP:</p>
  
  <pre><code>&lt;?php
   if($_POST){
       $name = trim($_POST["name"]);
       $sifre = trim($_POST["sifre"]);
  
      if(!$name || !$sifre){
  
          echo '&lt;div class="hata"&gt;kullancı adı ve sifre bos bırakılamaz&lt;/div&gt;';
  
  
      }else {
  
          $uye = $db-&gt;prepare("select * from users where Username=? and Password=? and uye_onay=?");
          $uye-&gt;execute(array($name,$sifre,1));
          $z = $uye-&gt;fetch(PDO::FETCH_ASSOC);
          $x = $uye-&gt;rowCount();
  
          if($x){
  
              $_SESSION["uye"] = $z["Username"];
              $_SESSION["eposta"] = $z["uye_eposta"];
              $_SESSION["rutbe"] = $z["uye_rutbe"];
              $_SESSION["id"] = $z["PlayerID"];
  
              header("location:index.php");
  
          }elseif($z["uye_onay"] == 0){
  
              echo '&lt;div class="hata"&gt;uyeliğiniz onaylanmadı yonetici onayını bekleyin..&lt;/div&gt;';
  
          } else {
  
              echo '&lt;div class="hata"&gt;uye adı yada sifreniz yanlıs&lt;/div&gt;';
  
          }
      }   
  
  ?&gt;
  </code></pre>