msoffice
1.0.0
sudo apt install libssl-dev
bin/msoffice-crypt.exe
の作り方Linux
mkdir work
git clone https://github.com/herumi/cybozulib
git clone https://github.com/herumi/msoffice
cd msoffice
make -j RELEASE=1
古いOpenSSLライブラリを使用する場合は、 make OLD_OPENSSL=1
。
Windows
mkdir work
git clone https://github.com/herumi/cybozulib
git clone https://github.com/herumi/msoffice
git clone https://github.com/herumi/cybozulib_ext # for openssl
cd msoffice
mk.bat ; or open msoffice12.sln and build
test
でtest.xlsxを暗号化します。 bin/msoffice-crypt.exe -e -p test test.xlsx enc.xlsx
test
でenc.xlsxを復号化します。 bin/msoffice-crypt.exe -d -p test enc.xlsx dec.xlsx
usage:msoffice-crypt.exe [opt] input output
-h : show this message
-p password in only ascii
-encMode 0:use AES128(default), 1: use AES256 for encoding
-ph8 password in utf8 hex. ex. 68656C6C6F for 'hello'
-ph16 password in utf16 hex. ex. u3042u3044u3046 for 'aiu' in hiragana
-k (experimental) secret key in hex. ex. 0123456789ABCDEF0123456789ABCDEF
-by (experimental) extract secret key from this file
-e encode
-d decode
-c spin count
-psk print secret key
-v print debug info
-vv print debug info and save binary data
Office 2010以降のオフィス文書形式は、どの接尾辞がPPTX、DOCX、XLSXであるか。
msoc.dll(Microsoft Office Crypto)
msoc.dll
msoc.h
pass
でinFile
暗号化し、 outFile
を作ります。
MSOC_encrypt(outFile, inFile, pass, NULL);
pass
でinFile
を復号化し、 outFile
を作ります。 MSOC_decrypt(outFile, inFile, pass, NULL);
inFile
、 outFile
、 pass
のタイプはconst wchar_t*
(utf-16文字列)です。 csampleコードとpythonサンプルコードを参照してください。
libmsoc.lib
pass
でinFile
暗号化し、 outFile
を作ります。
MSOC_encryptA(outFile, inFile, pass, NULL);
pass
でinFile
復号化し、 outFile
を作ります。 MSOC_decryptA(outFile, inFile, pass, NULL);
inFile
、 outFile
、 pass
のタイプはconst char*
(ascii文字列)です。ミニCサンプルコードを参照してください。
BSD 3-Clauseライセンス
Copyright(c)2015 Cybozu Labs、Inc。All Rights Reserved。