
Edward
首先打开应用
登录账号,进入主界面

点击左侧Settings,点击Security,点击右侧Keys,再点击下方的View API Key。

输入你的账号密码后, 就会出现下方的API Key。我们需要用到Client ID和Client Secret这两个值,复制保留。

打开端口转发工具,配置VaultWarden端口,可参考下图

打开应用,需要进行配置向导设置。
服务地址填入刚才配置的端口转发地址,其余配置按需修改,也可按照默认进行。

进入应用后,需要按照下图进行以下配置:
Bitwarden Client ID:上面获取Client ID
Bitwarden Client Secret:上面获取的Client Secret
Bitwarden Master Password: ValutWarden的登录密码
Backup File Password:备份文件加密密码(可选)

配置完之后,点击Initialize,如果无误,就会显示下图,就表示配置成功了,可以关闭页面了。

打开懒猫网盘,左侧点击应用数据,找到BackVault,点击进入

然后选择backup文件,就可以看到刚才备份的加密文件了。

我这边以macos系统上操作为示例:
brew install python
python3 -m venv ~/backvault-decrypt
source ~/backvault-decrypt/bin/activate
pip install cryptography

# decrypt.py
import sys
from getpass import getpass
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
from cryptography.hazmat.primitives import hashes
from cryptography.exceptions import InvalidTag
SALT_SIZE = 16
NONCE_SIZE = 12
TAG_SIZE = 16
KEY_SIZE = 32
PBKDF2_ITERATIONS = 600000 # 若你在 VaultWarden 改过迭代次数,这里也要改;没改就按照默认值
def decrypt_data(encrypted_data: bytes, password: str) -> bytes:
salt = encrypted_data[:SALT_SIZE]
nonce = encrypted_data[SALT_SIZE:SALT_SIZE+NONCE_SIZE]
ciphertext_with_tag = encrypted_data[SALT_SIZE+NONCE_SIZE:]
ciphertext = ciphertext_with_tag[:-TAG_SIZE]
tag = ciphertext_with_tag[-TAG_SIZE:]
kdf = PBKDF2HMAC(algorithm=hashes.SHA256(), length=KEY_SIZE, salt=salt, iterations=PBKDF2_ITERATIONS)
key = kdf.derive(password.encode("utf-8"))
aesgcm = AESGCM(key)
return aesgcm.decrypt(nonce, ciphertext + tag, None)
if __name__ == "__main__":
if len(sys.argv) < 2:
print(f"Usage: python {sys.argv[0]} <encrypted_file> [password]")
sys.exit(1)
file_path = sys.argv[1]
password = sys.argv[2] if len(sys.argv) > 2 else getpass("Enter backup password: ")
try:
with open(file_path, "rb") as f:
encrypted_contents = f.read()
decrypted_json = decrypt_data(encrypted_contents, password)
out_path = file_path.rsplit(".", 1)[0] + ".json"
with open(out_path, "w", encoding="utf-8") as wf:
wf.write(decrypted_json.decode("utf-8"))
print(f"Decryption OK -> {out_path}")
except InvalidTag:
print("Decryption failed: Invalid password or corrupted file.")
except Exception as e:
print(f"An error occurred: {e}")
python “decrypt.py路径” "你的Backup File路径" "你的Backup File Password,如上面没配置,就不需要"



注意:应用关闭再打开后,会显示502,属于正常现象。因为软件已经配置成功,转为后台服务,可查看应用日志看进程,也可以到懒猫网盘,应用数据下看到新生成的备份文件,见下图。

评论
0暂无评论