tit檔案的加密解密

2022-06-15 15:54:07 字數 925 閱讀 9106

#

hello 原始檔

#ifmmp 加密

#hello 解密

file = open("

email.txt

","r

") #

原始檔 只針對字元不需要加b進行二進位制

filejia = open("

emailjia.txt

","w

") #

被加密的檔案

ch=true

while

ch: ch=file.read(1) #

讀取乙個字元

if ch:#

讀取到了

jiach= chr(ord(ch)+1) #

加密的字元

filejia.write(jiach)

file.close()

filejia.close()

#

hello 原始檔

#ifmmp 加密

#hello 解密

file = open("

emailjia.txt

","r

") #

原始檔 只針對字元不需要加b進行二進位制

filejie = open("

emailjie.txt

","w

") #

被加密的檔案

ch=true

while

ch: ch=file.read(1) #

讀取乙個字元

if ch:#

讀取到了

jiach= chr(ord(ch)-1) #

解密字元

filejie.write(jiach)

file.close()

filejie.close()

檔案的加密解密

專案需要對一些配置檔案進行加密處理,自己實現了簡單的demo,原理是對乙個字元使用同乙個key進行偶數次異或等於自身。如下 include stdafx.h include include include include std string getfullpath const char filen...

加密解密檔案

1 decrypt 方法允許解密使用 encrypt 方法加密的檔案。decrypt 方法只能解密使用當前使用者帳戶加密的檔案。23 decrypt 方法要求獨佔訪問被解密的檔案,如果有其他程序正在使用該檔案,此方法將引發異常。如果檔案沒有加密,則 decrypt 將返回乙個非零值,這表示成功。45...

檔案加密解密 URl引數加密解密

sliverlight 加密解密 public static class encryption endregion region silverlight密碼解密 解密資料 加密後的字串 加密前的字串 public static string decrypt string input endregio...