如何获得在窗体身份验证票证使用PHP内容 [英] How to get at contents of Forms Authentication ticket with PHP

查看:185
本文介绍了如何获得在窗体身份验证票证使用PHP内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要撤消在PHP下面的ASP.Net的过程,所以我可以在一张票的用户名和到期日获得。我已经解密的3DES加密(下面的步骤3),但我不知道我下一步需要做。是起因于解密的字节数组的字符串?我应该能够将其转换为ascii码? (因为它没有)。

I need to undo the following ASP.Net processes in PHP so I can get at the username and expiration date in a ticket. I've decrypted the 3DES encryption (step 3 below) but I'm not sure what I need to do next. Is the string that results from decryption a byte array? Should I be able to convert it to ascii? (Because it doesn't).

什么ASP.Net并创造票:

What ASP.Net does to create ticket:

  1. 在序列化的用户名,过期,其他数据(我不在乎)。创建一个字节数组。
  2. 登入使用SHA1票(SIG的是最后20个字节)
  3. 在加密与3DES(我已经加密)的车票。

我回来的东西,看起来像这样:

I get back something that looks like this:

6E 85 A4 39 71 31 46 BB A3 F6 BE 1A 07 EE A4 CE 5F 03 C8 D1 4C 97 5D 6A 52 D1 C4 82 75 5E 53 06 7B维D2 4D BF 22 40 F7 F4 B8 8D B0 C3 EC E5 BE F7 52 C2东风00 7A D1 CB公元前76 4B 10 33二维1A B4 15 A7 BB D6 9D BF 41 69 D2 C4 43 4A 26 95 01 F2 06 AA 46 2C 96 CC AD DC 08 59 C0 64 B6 EE 2C 5F CA ED 8B 92 1C 80 FD FF DC 61 67 28 59 CB E6 71 C6 C3 72 0E D0 32 69 22 57 4E 40 2B DA 67 BA 7F F1 C5 78 BC DF 80 8C D8 F2 8B 19 E2 A4 4F 7C 8C D9 97 37 BD B5 5B 0A 66 9B DD E7 DC 7B 78 F4 F8

6E 85 A4 39 71 31 46 BB A3 F6 BE 1A 07 EE A4 CE 5F 03 C8 D1 4C 97 5D 6A 52 D1 C4 82 75 5E 53 06 7B 1D D2 4D BF 22 40 F7 F4 B8 8D B0 C3 EC E5 BE F7 52 C2 DF 00 7A D1 CB BC 76 4B 10 33 2D 1A B4 15 A7 BB D6 9D BF 41 69 D2 C4 43 4A 26 95 01 F2 06 AA 46 2C 96 CC AD DC 08 59 C0 64 B6 EE 2C 5F CA ED 8B 92 1C 80 FD FF DC 61 67 28 59 CB E6 71 C6 C3 72 0E D0 32 69 22 57 4E 40 2B DA 67 BA 7F F1 C5 78 BC DF 80 8C D8 F2 8B 19 E2 A4 4F 7C 8C D9 97 37 BD B5 5B 0A 66 9B DD E7 DC 7B 78 F4 F8

这不映射到ASCII码,我该怎么办?我有SHA1校验密钥。感谢您的帮助!

It doesn't map to ascii, what do I do next? I have the SHA1 validation key. Thanks for any help!

推荐答案

我一直在努力出来,我设法得到窗体身份验证票的内容在PHP。

I've been working it out, and I have managed to get the forms authentication ticket contents in PHP.

  1. 解密的车票与习惯了在.NET方面加密相同的密钥。对于这一点,我使用 http://www.navioo.com/ PHP /文档/ function.mcrypt-encrypt.php

解密添加填充到字符串的结尾,我删除。

The decryption adds padding to the end of the string, I remove that.

我留下了一串具有20字节的SHA1哈希在最后。那些过去的​​20个字节(应该)匹配的字符串的第一部分的SHA1哈希(字符​​串长度 - 20字节)。我仍然在这部分,试图找出如何.NET将字节数组转换成数据单丛,可以SHA1散列(所以我可以做在PHP端相同)。

I'm left with a string with a 20 byte SHA1 hash at the end. Those last 20 bytes (should) match the SHA1 hash of the first part of the string (string length - 20 bytes). I'm still working on this part, trying to figure out how .NET converts a byte array into a single clump of data that can be SHA1 hashed (so I can do the same on the PHP side).

这真的就是这么简单。

That's really all there is to it.

这篇关于如何获得在窗体身份验证票证使用PHP内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆