Unix Technical Forum

Encrypted Blob Text?

This is a discussion on Encrypted Blob Text? within the MySQL forums, part of the Database Server Software category; --> Hi, I'm fairly new to databases and mysql (I'm mostly a graphics programmer). I'm writing a php script which ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 11:23 AM
Dread Task Force Plutonium 5
 
Posts: n/a
Default Encrypted Blob Text?

Hi,

I'm fairly new to databases and mysql (I'm mostly a graphics
programmer).

I'm writing a php script which accesses a database I did not create. I
cannot control the structure of the table, nor can I view the source
code used to add entries to the database.

Here's my problem: text entered in one of the blobs that I need to
access is somehow encrypted. I can't find anything about blobs being
encrypted under normal circumstances. I'm hoping this is just sql
naivety, and that there is some call to decrypt the blob so I can use
it.

I entered 0123456789 into the blob and got back:
MDEyMzQ1Njc4OQ==

I don't know if that will help or not.

If this is not normal behavior for blobs, does anyone have a
suggestion for how I can decrypt the text stored in the blob and move
on with my life?

Thanks,
Nate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 11:23 AM
Jerry Stuckle
 
Posts: n/a
Default Re: Encrypted Blob Text?

Dread Task Force Plutonium 5 wrote:
> Hi,
>
> I'm fairly new to databases and mysql (I'm mostly a graphics
> programmer).
>
> I'm writing a php script which accesses a database I did not create. I
> cannot control the structure of the table, nor can I view the source
> code used to add entries to the database.
>
> Here's my problem: text entered in one of the blobs that I need to
> access is somehow encrypted. I can't find anything about blobs being
> encrypted under normal circumstances. I'm hoping this is just sql
> naivety, and that there is some call to decrypt the blob so I can use
> it.
>
> I entered 0123456789 into the blob and got back:
> MDEyMzQ1Njc4OQ==
>
> I don't know if that will help or not.
>
> If this is not normal behavior for blobs, does anyone have a
> suggestion for how I can decrypt the text stored in the blob and move
> on with my life?
>
> Thanks,
> Nate
>


No, this is not normal behavior for blobs. Blobs are strictly binary
entities - what you put in you should get back out.

You need to talk to the people inserting data into the table to see what
they are doing.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 11:23 AM
Gordon Burditt
 
Posts: n/a
Default Re: Encrypted Blob Text?

>I'm fairly new to databases and mysql (I'm mostly a graphics
>programmer).
>
>I'm writing a php script which accesses a database I did not create. I
>cannot control the structure of the table, nor can I view the source
>code used to add entries to the database.


Can you access the database directly with MySQL (leaving PHP and especially
PHP code you didn't write out of it entirely)?

>Here's my problem: text entered in one of the blobs that I need to
>access is somehow encrypted.


Normally, if it goes IN plaintext, it comes OUT plaintext. If it goes IN
encrypted, it comes OUT encrypted. Exceptions to this involve quoting
of things like backslashes, quotes, and nul bytes in the query itself.
Triggers can do things arbitrarily complicated to data in queries.

There's an organization called the National Security Agency that can handle
encryption difficult problems. You can't afford them.

>I can't find anything about blobs being
>encrypted under normal circumstances. I'm hoping this is just sql
>naivety, and that there is some call to decrypt the blob so I can use
>it.


A trigger *could* be used to encrypt data on the way in.

>I entered 0123456789 into the blob and got back:
>MDEyMzQ1Njc4OQ==


Using only MySQL? Or did some of the PHP code you didn't write get
hold of it on the way in or out?

In PHP, base64_encode("0123456789") comes out with that string above.
You'd use base64_decode to decode it.

>I don't know if that will help or not.
>
>If this is not normal behavior for blobs, does anyone have a
>suggestion for how I can decrypt the text stored in the blob and move
>on with my life?


Take a stab with base64_decode() in PHP.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 11:23 AM
Dread Task Force Plutonium 5
 
Posts: n/a
Default Re: Encrypted Blob Text?

Hi, base64_decode() did the trick. Thanks a lot! I didn't know that
function existed.

On Aug 6, 6:57 pm, gordonb.zf...@burditt.org (Gordon Burditt) wrote:
> >I'm fairly new to databases and mysql (I'm mostly a graphics
> >programmer).

>
> >I'm writing a php script which accesses a database I did not create. I
> >cannot control the structure of the table, nor can I view the source
> >code used to add entries to the database.

>
> Can you access the database directly with MySQL (leaving PHP and especially
> PHP code you didn't write out of it entirely)?
>
> >Here's my problem: text entered in one of the blobs that I need to
> >access is somehow encrypted.

>
> Normally, if it goes IN plaintext, it comes OUT plaintext. If it goes IN
> encrypted, it comes OUT encrypted. Exceptions to this involve quoting
> of things like backslashes, quotes, and nul bytes in the query itself.
> Triggers can do things arbitrarily complicated to data in queries.
>
> There's an organization called the National Security Agency that can handle
> encryption difficult problems. You can't afford them.
>
> >I can't find anything about blobs being
> >encrypted under normal circumstances. I'm hoping this is just sql
> >naivety, and that there is some call to decrypt the blob so I can use
> >it.

>
> A trigger *could* be used to encrypt data on the way in.
>
> >I entered 0123456789 into the blob and got back:
> >MDEyMzQ1Njc4OQ==

>
> Using only MySQL? Or did some of the PHP code you didn't write get
> hold of it on the way in or out?
>
> In PHP, base64_encode("0123456789") comes out with that string above.
> You'd use base64_decode to decode it.
>
> >I don't know if that will help or not.

>
> >If this is not normal behavior for blobs, does anyone have a
> >suggestion for how I can decrypt the text stored in the blob and move
> >on with my life?

>
> Take a stab with base64_decode() in PHP.



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:16 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com