我要给文本文件进行加密,请问有没有比较简单的加密算法,当然该算法是可逆的,因为我还要解密。

解决方案 »

  1.   

    矩阵变换、异或运算、BASE64编码,实在不行把每个字符的ASCII码加上3也可以,一般人搞不清你使用了什么加密法。
      

  2.   

    最简单的办法:异或算法
    原理: if A XOR B = C then C XOR B = A
    A是明文,B是密码,C是密文
      

  3.   

    异或就不说了。base64编码作为公开编码方式,只能蒙混一般用户。
    具体base64编码的帖子:
    http://expert.csdn.net/Expert/topic/2590/2590761.xml
      

  4.   

    Option ExplicitPrivate Sub Command1_Click()
       Dim inputFile As String
       Dim Outputfile As String
       Dim password As Integer
       
       inputFile = InputBox(请输入加密/解密的文件名称”,”加密/解密”)
       Outputfile = InputBox(请输入加密/解密后的文件名称”,”加密/解密到")
       password = InputBox("请输入密码 "﹐”密码”)
       Call CodedFile(inputFile, Outputfile, password)
       MsgBox "文件已经加密/解密到ì: " + Outputfile, , "完成"
       End
    End SubPrivate Sub CodedFile(inputFile As String, Outputfile As String, password As Integer)
      Dim char As String * 1
      Dim z As Integer
      
      Open inputFile For Binary As #1
      Open Outputfile For Binary As #2
      For z = 1 To FileLen(inputFile)
      Get 1, , char
      char = Chr((Asc(char) Xor password))
      
      Put 2, , char
      Next z
      Close #1
      Close #2
      
    End Sub
    最簡單的解密碼了。其實就是 chewinggum(口香糖·目标两颗星星)說的道理
    print asc("a") xor 23
    118
    print chr(118)
    v
    print chr(23 xor 118)
    a
    看見吧﹐其實就這樣簡單的。
      

  5.   

    呵呵,如果你真地想研究一下加密就和我QQ联系,我给你一本计算机密码学的电子书,里面从简单原始的循环加密法到复杂的RSA算法、背包算法等等,什么样的加密算法都有了。
      

  6.   

    RSA算法以前在學校時候還研究過﹐后來﹐呵呵~~都忘記了。
    現在很多東西居然是從頭開始