如何快速的加密很大的 excel 文件 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
AnyThingElae
V2EX    Python

如何快速的加密很大的 excel 文件

  •  
  •   AnyThingElae 2021-12-20 17:55:40 +08:00 3292 次点击
    这是一个创建于 1396 天前的主题,其中的信息可能已经有所发展或是发生改变。

    尝试过使用 python 的 win32com 进行加密,文件小的情况下没问题,文件一大就卡住了

    代码如下

    xcl = win32com.client.DispatchEx('Excel.Application') xcl.DisplayAlerts = False wb = xcl.workbooks.open(decrypt_excel_path, False, False, None) wb.SaveAs(encrypt_excel_path, None, excel_key, '') 
    第 1 条附言    2021-12-21 16:23:17 +08:00
    找到了个不错的加密库,速度不错 herumi/msoffice
    12 条回复    2021-12-22 09:44:53 +08:00
    kokutou
        1
    kokutou  
       2021-12-20 18:05:56 +08:00 via Android   1
    xit 搞 64 位,装固态上,别装任何其他软件,就一个 excel ,然后 excel 文件丢固态上
    再运行脚本试试。。。
    AnyThingElae
        2
    AnyThingElae  
    OP
       2021-12-20 18:23:05 +08:00
    @kokutou 感谢
    xchaoinfo
        3
    xchaoinfo  
       2021-12-21 09:26:57 +08:00   1
    用这个库 msoffcrypto-tool
    xingshu1990
        4
    xingshu1990  
       2021-12-21 10:00:06 +08:00
    @xchaoinfo 精灵球!
    llsquaer
        5
    llsquaer  
       2021-12-21 11:15:38 +08:00
    想到一个自己写的加密...将文件从开始 (自定义字节数),做一个位移运算,(或者移位到后面去..) 管你多大的文件,微秒级加密..当然.只是系统打不开而已...没研究过二进制的搞不明白..... python 用 < > 这 2 个符号就搞定的事情.
    AnyThingElae
        6
    AnyThingElae  
    OP
       2021-12-21 11:31:07 +08:00
    @xchaoinfo 谢谢,我试试哈
    echoechoin
        7
    echoechoin  
       2021-12-21 11:47:05 +08:00
    openssl aes 加密?
    SmiteChow
        8
    SmiteChow  
       2021-12-21 15:44:21 +08:00
    还需要写代码? zip 加密码不行吗?
    AnyThingElae
        9
    AnyThingElae  
    OP
       2021-12-21 16:23:33 +08:00
    @SmiteChow 需求是这样的
    SmiteChow
        10
    SmiteChow  
       2021-12-21 18:02:45 +08:00
    @AnyThingElae 命令行操作呀 `zip -P password test.zip test.txt`
    AnyThingElae
        11
    AnyThingElae  
    OP
       2021-12-21 18:11:26 +08:00
    @SmiteChow 嗯。目前需求是打开 excel 文件需要密码。。打包不符合需求,所以现在用 herumi/msoffice 来加密了
    SmiteChow
        12
    SmiteChow  
       2021-12-22 09:44:53 +08:00
    @AnyThingElae 你的这个实现恐怕得专门定制解密工具才行吧,意味着文件传播出去别人知道密码也不能打开。zip 格式在所有平台都自带客户端能解密,要是纠结压缩这个词语,可以把文件后缀带上,比如 test.txt.zip 。
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     6264 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 23ms UTC 02:04 PVG 10:04 LAX 19:04 JFK 22:04
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86