Jump to content

Base 64 decode

smush
Go to solution Solved by Sauron,

You're always decoding the same value since you always pass $content to the function. Try this

<?php
$input =  file_get_contents("b64.txt");
$x = 0;

while($x < 50) {
$input = base64_decode ($input);
	$x++;
}
echo $input;

?> 

 

Hi

I'm trying to decode a file that has been based 64'd 50 times. I started out ensuring the php script and the file to be decoded are in the same location. After that I got the contents of the file then set up a while loop to go through 50 times running 'base_64 decode' on the file after that I tried to echo the file but I get I feel whatever is missing will be pretty obvious once it is pointed out. Thanks.

<?php
$content =  file_get_contents("b64.txt");
$x = 0;

while($x < 50) {
$input = base64_decode ($content);
	$x++;
}
echo $input;

?> 

 

Link to comment
Share on other sites

Link to post
Share on other sites

You're always decoding the same value since you always pass $content to the function. Try this

<?php
$input =  file_get_contents("b64.txt");
$x = 0;

while($x < 50) {
$input = base64_decode ($input);
	$x++;
}
echo $input;

?> 

 

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×