b64_md5 算法,作者:Paul Johnston,网址:http://pajhome.org.uk/crypt/md5

发布于 2024-11-24 08:18:50 字数 1259 浏览 0 评论 0原文

我正在尝试使用 phpcurl 来获取网上银行交易。不幸的是,银行使用 b64_md5 算法将用户名和密码传递到此脚本 md5.js 完成的服务器。我用 google 搜索了一个 php 函数来模拟这个。但我可以找到一些帮助。

这是他们生成密码的代码,

function checkScript(){
    pCheckScript.innerHTML = "";
    document.form_000001.pSubmit.disabled = false;
    document.form_000001.pCancel.disabled = false;
    document.form_000001.challenge.value = "[B@6be16be1"
    document.form_000001.login_name.focus();}
function submitForm(){
    var vPassword = "";
    for (var i = 0; i < document.form_000001.password.value.length; i++)vPassword = vPassword + "*";
    document.form_000001.login_name.size = 1;
    document.form_000001.password.size = 1;
    document.form_000001.login_name.style.visibility = "hidden";
    document.form_000001.password.style.visibility = "hidden";
    textLoginName.innerHTML = document.form_000001.login_name.value;
    textLoginPassword.innerHTML = vPassword;
    document.form_000001.login_name.value = b64_md5(document.form_000001.login_name.value.toLowerCase());
    document.form_000001.password.value = b64_md5(b64_md5(document.form_000001.password.value) + document.form_000001.challenge.value);
    return true;}

问题是,如何构建 php 函数来模拟这个。

i'm trying to use php curl to grab internet banking transaction. unfortunately the bank uses b64_md5 algorithm to pass the username and password to the server done by this script md5.js . i've googled a php function to simulate this. but i can find something help.

here is their code to generate the password

function checkScript(){
    pCheckScript.innerHTML = "";
    document.form_000001.pSubmit.disabled = false;
    document.form_000001.pCancel.disabled = false;
    document.form_000001.challenge.value = "[B@6be16be1"
    document.form_000001.login_name.focus();}
function submitForm(){
    var vPassword = "";
    for (var i = 0; i < document.form_000001.password.value.length; i++)vPassword = vPassword + "*";
    document.form_000001.login_name.size = 1;
    document.form_000001.password.size = 1;
    document.form_000001.login_name.style.visibility = "hidden";
    document.form_000001.password.style.visibility = "hidden";
    textLoginName.innerHTML = document.form_000001.login_name.value;
    textLoginPassword.innerHTML = vPassword;
    document.form_000001.login_name.value = b64_md5(document.form_000001.login_name.value.toLowerCase());
    document.form_000001.password.value = b64_md5(b64_md5(document.form_000001.password.value) + document.form_000001.challenge.value);
    return true;}

the queston is, how to build php function to simulate this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜妞爱困 2024-12-01 08:18:51

以下是使用 base64_encodemd5

<?php

// This assumes that the challenge never changes.
$challenge = '[B@6be16be1';

$username = base64_encode(md5(strtolower('username')));
$password = base64_encode(md5(base64_encode(md5('password')) . $challenge));

Here's an example that uses base64_encode and md5.

<?php

// This assumes that the challenge never changes.
$challenge = '[B@6be16be1';

$username = base64_encode(md5(strtolower('username')));
$password = base64_encode(md5(base64_encode(md5('password')) . $challenge));
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文