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 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64
  • ¥15 iOS 自定义输入法-第三方输入法