drwg89980 2009-11-16 15:05
浏览 25
已采纳

coldfusion在php中解密

I'm not English speaker, sorry in advance.

I have a ColdFusion 6.1 application, and now I'm trying to migrate to another environment. In the ColdFusion application, the passwords of my users are crypted with a ColdFusion function:

password_encrypted=toBase64(encrypt(text,key));

Does anyone know how can I decrypt it in PHP? I don't know what the cypher algorithm used in CFMX 6.1 is. I think that the name of the algorithm is CFMX_COMPAT, but I don't know if it has an equivalent in PHP.

Thanks!!!

  • 写回答

2条回答 默认 最新

  • doxn43207 2009-11-16 15:18
    关注

    If I'm not mistaken, the default CFMX_COMPAT function is simply a XOR.

    So in PHP this would be as simple as:

    $password_encrypted = base64_encode($text ^ $key);
    

    Hope this helps.

    Edit:

    I was curious so I wrote a little script to test, and this might be reversed, here is the encrypt/decrypt.

    <?php
    
    $text = 'test';
    $key = 'asdf';
    
    $password_encrypted = base64_encode($key ^ $text);
    
    echo $password_encrypted . "<br>
    ";
    
    $password_decrypted = base64_decode($password_encrypted) ^ $key;
    
    echo $password_decrypted;
    
    ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 DS18B20内部ADC模数转换器
  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动