0

I am working on upgrading an old php system into .net. I am having trouble reading value from a column type of longtext. The data seems to be encrypted and I have no idea what was used to encrypt the data. There are around 1800 rows with this encrypted data in longtext column. I tried to run a select which makes the system unstable mostly but still was able to get the value which is huge for a cell. A typical value looks like this

O:8:"cuesheet":13:{s:2:"db";O:6:"db_log":23:{s:4:"user";O:8:"auth_acl":17:{s:16:"broadcast_groups";a:3:{i:0;s:23:"broadcast_administrator";i:1;s:23:"broadcast_cuesheet_user";i:2;s:21:"onmusic_administrator";}s:2:"db";O:8:"db_mysql":25:{s:6:"_debug";b:0;s:19:"_default_error_mode";N;s:22:"_default_error_options";N;s:22:"_default_error_handler";s:0:"";s:12:"_error_class";s:8:"DB_Error";s:16:"_expected_errors";a:0:{}s:8:"features";a:4:{s:7:"prepare";b:0;s:8:"pconnect";b:1;s:12:"transactions";b:1;s:5:"limit";s:5:"alter";}s:13:"errorcode_map";a:17:{i:1004;i:-15;i:1005;i:-15;i:1006;i:-15;i:1007;i:-5;i:1008;i:-17;i:1022;i:-5;i:1046;i:-14;i:1050;i:-5;i:1051;i:-18;i:1054;i:-19;i:1062;i:-5;i:1064;i:-2;i:1100;i:-21;i:1136;i:-22;i:1146;i:-18;i:1048;i:-3;i:1216;i:-3;}s:7:"phptype";s:5:"mysql";s:14:"prepare_tokens";a:0:{}s:13:"prepare_types";a:0:{}s:16:"prepared_queries";a:0:{}

This is just a small part of the value. Is there anyway of decoding this value.

Scott Arciszewski
  • 33,610
  • 16
  • 89
  • 206
  • 4
    It's `serialize()` output. It's not "encrypted". It's just "encoded". – Marc B Nov 04 '14 at 17:19
  • Thanks Mark. How can I deserialize this in mysql ? I am not using php – user3756152 Nov 04 '14 at 17:21
  • 1
    you can't. it's not mysql's job to do that. You can use string operations to extract portions if you want, but you should NOT be updating the values - you'll probably corrupt it. – Marc B Nov 04 '14 at 17:22
  • You can write a stored procedure to deserialize that stuff. That would be an overkill, but technically, it's possible. You can also port the php deserialize() function to C# (or whatever language you are using) to deserialize the data there. – Psi Nov 02 '19 at 01:17

0 Answers0