Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7927887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:33:06+00:00 2026-06-03T19:33:06+00:00

PHP code: $key = 12345678abcdefgh12345678abcdefgh; $iv = 12345678abcdefgh; $plaindata = This is a test

  • 0

PHP code:

$key = "12345678abcdefgh12345678abcdefgh";
$iv = "12345678abcdefgh";
$plaindata = "This is a test string.";

$enc = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plaindata, MCRYPT_MODE_CBC, $iv));

echo($enc);

Result:

QBN0Yue3D9hBrBuD01n5KWG+lv2doMf97cKm/AeusAI=

How can this be decrypted in Python?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T19:33:07+00:00Added an answer on June 3, 2026 at 7:33 pm

    Try something like this (altho i do have PyCrypto installed)

    from Crypto.Cipher import AES
    import base64
    
    AES.key_size=128
    iv="your iv"
    key="your key"
    crypt_object=AES.new(key=key,mode=AES.MODE_CBC,IV=iv)
    
    decoded=base64.b64decode(plain) # your ecrypted and encoded text goes here
    decrypted=crypt_object.decrypt(decoded)
    

    This will bring the decoded text but it will be padded with bytes for it to be a size multiple of 16.

    You should probably decide on a proper padding scheme and remove it afterwards accordingly

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my php code echo '<pre>'; print_r($weekdays); echo '<br/>'; foreach ($weekdays as $key
PHP code: function compute_signature($key, $hash_string) { $digest = hash_hmac(sha1, $hash_string, $key, true); return base64_encode($digest);
I dont know what's wrong with this PHP code: $sql = CREATE TABLE test
This is the PHP code I have. function decrypt($s_input, $s_key, $s_iv) { $s_decrypted =
I found this PHP code in an app I have to modify... $links =
I often see this idiom when reading php code: public function __construct($config) { if
I currently have PHP code that handles the logic for this because I do
Im trying to decode a json string returned from flickr within my PHP code.
Strange issue. This is index.php: session_start(); print_r($_COOKIE); print_r($_SESSION); This is logout.php: session_destroy(); $_COOKIE['key'] =
The following PHP code prints out this warning: Warning: openssl_csr_get_public_key(): supplied resource is not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.