GithubHelp home page GithubHelp logo

hartl3y94 / msoffice Goto Github PK

View Code? Open in Web Editor NEW

This project forked from herumi/msoffice

1.0 0.0 0.0 9.62 MB

License: BSD 3-Clause "New" or "Revised" License

Makefile 2.03% C++ 86.92% Batchfile 0.54% Python 4.01% C 5.77% VBScript 0.73%

msoffice's Introduction

A tool/lib to encrypt/decrypt Microsoft Office Document

Environment

  • 64-bit Windows Visual Studio 2012 or later
  • gcc 4.6, clang 3.0 or later

How to make 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

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

How to use

  • Encrypt test.xlsx with a password test.
bin/msoffice-crypt.exe -e -p test test.xlsx enc.xlsx
  • Decrypt enc.xlsx with a password test.
bin/msoffice-crypt.exe -d -p test enc.xlsx dec.xlsx
  • Other options
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

Return code

  • 0 success
  • 1 not support formart
  • 2 already encrypted with -e or decrypted with -d
  • 3 bad password with -d

Support format

Office 2010 or later Office Document format which suffix is pptx, docx, xlsx.

DLL for Windows

  • msoc.dll (Microsoft Office Crypto)

  • msoc.dll

  • msoc.h

  • Encrypt inFile with pass and make outFile.

MSOC_encrypt(outFile, inFile, pass, NULL);
  • Decrypt inFile with pass and make outFile.
MSOC_decrypt(outFile, inFile, pass, NULL);

Remark

The type of inFile, outFile and pass are const wchar_t*(UTF-16 string). See Csample code and Python sample code.

lib for Linux

  • libmsoc.lib

  • Encrypt inFile with pass and make outFile.

MSOC_encryptA(outFile, inFile, pass, NULL);
  • Decrypt inFile with pass and make outFile.
MSOC_decryptA(outFile, inFile, pass, NULL);

Remark

The type of inFile, outFile and pass are const char*(ascii string). See mini C sample code.

License

BSD 3-Clause License

Copyright (c) 2015 Cybozu Labs, Inc. All rights reserved.

References

msoffice's People

Contributors

didierstevens avatar gaolycn avatar herumi avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.