dousi1994 2016-10-08 13:30
浏览 106
已采纳

可逆的哈希类型算法? [关闭]

Odd question...but I need a private key encryption (or complex enough encoding) that outputs 64 random characters - given a string of 30 characters.

Blowfish or similar seems over kill and would probably not produce the fixed 64 byte result...also I'm less concerned with security more concerned with tampering - so a simple encoding scheme like rot13 won't suffice.

Short of using something like blowfish or building from scratch...

Any existing code I could pull from?

I guess I could pad the 30 char with the remaining 34 then basically I have to scramble all the chars -preferably using a private key.

Any existing packagist project I could use???

  • 写回答

1条回答 默认 最新

  • douhuang1852 2016-10-08 14:05
    关注

    If you're not looking for something completely solid and cryptographically strong, you may just use RC4 algorithm with shared secret.

    The implementation is here, for example - https://gist.github.com/farhadi/2185197

    As for making the output exactly 64 bytes long - what's wrong with padding?

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 宇视监控服务器无法登录
  • ¥15 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥15 DruidDataSource一直closing
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误
  • ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据