Cryptographic Hash Functions UNO Component for OpenOffice.org

5
Average: 5 (1 vote)

The Cryptographic Hash Functions UNO Component for OpenOffice.org ("org.openoffice.Cryptographic.CryptographicService") computes hashes (message digests) of text and files using following hashing algorithms: MD2, MD5, SHA-1, SHA-256, SHA-384 and SHA-512.
Source Code and Examples (FILEHASH and TEXTHASH functions.ods, Find Duplicate Files.odb) in https://sourceforge.net/projects/cryptographic/files/

Download extension
Operating System: System Independent
Compatible with: OpenOffice.org 3.1 or higher.
Version: 1.10.01
Date: 2009-Oct-03
Size: 8.73 KB
License: Opensource | GNU Lesser General Public License

Source code: Browse source code
Downloads: Today: 0 | Week: 1 | Month: 21 | Year: 2,265

Comments

Bug : sometimes gives only 39 characters

Hello,

Some results are given with 39 characters instead of 40.

Exemple, when I hash :
noe.dekkerf29ru6ap
it gives me:
accf66bbda7debaf7813a8dd9827c1ca29adb3e

Misses one character. I discovered that the one missing is a 0 at the beginning, the correct hash is:
0accf66bbda7debaf7813a8dd9827c1ca29adb3e

Can somebody find the origin of this bug ? I'm not a programmer.
Thanks.

Getting it to work

I found I installed the uno. Then from the example sheet from sourceforge there is a basic macro adding the functions.
When you create a new sheet, you need to add this basic macro (copy/paste) to the new sheet and the functions will work.

REM Propósito: Computes hashes (message digests) of text and files using following hashing algorithms: MD2, MD5, SHA-1, SHA-256, SHA-384 and SHA-512
REM Informações sobre o Módulo: Módulo Padrão = basMain
REM Convenção para nomeclatura das versões: a.mm[.dd]: Nome do Revisor (e-mail)
REM Autor: Claudio Gomes Riella (cgriella@ufrgs.br)
REM Versões:
REM 1.10.01 (1º/10/2009): Claudio Gomes Riella (cgriella@ufrgs.br)
REM Parâmetros<-Argumentos: Main
REM FileHash(strFullPathName as String, strAlgorithm As String) <- Calc function FILEHASH(Cell; Algorithm)
REM TextHash(strText as String, strAlgorithm As String) <- Calc function TEXTHASH(Cell; Algorithm)
REM Resultados: return message digests
REM Requisitos mínimos: BrOffice.org 3.1.0 ou OpenOffice.org 3.1.0 + Cryptographic Service 1.10.01
REM Licença: LGPL

Sub Main
Dim strFullPathName as String, sbNewLine as String
sbNewLine = Chr(13) + Chr(10)
strFullPathName = inputbox ("Insert the path of file")
msgbox "File is """ & strFullPathName & """" & sbNewLine & "FileHash: " & FileHash(strFullPathName, "MD5") & sbNewLine & "TextHash: " & TextHash(strFullPathName, "MD5")
End Sub

Function FileHash(strFullPathName as String, strAlgorithm As String)
Dim objDecrypt As Object
Set objDecrypt = CreateUnoService("org.openoffice.Cryptographic.CryptographicService")
FileHash = objDecrypt.GetFileHash(strFullPathName, strAlgorithm)
End Function

Function TextHash(strText as String, strAlgorithm As String)
Dim objDecrypt As Object
Set objDecrypt = CreateUnoService("org.openoffice.Cryptographic.CryptographicService")
TextHash = objDecrypt.GetTextHash(strText, strAlgorithm)
End Function

Please help!

I have installed the extension and your example spreadsheet works great.

However, the formula typed in a new spreadsheet does not work. What am I missing?

Your help would be greatly appreciated!

Plugin does not work

Ok, may be I skrewed something up, but this extension does not do anything for me. Also the example ODS sheet does not work. I tested it on three different machines (Fedora, WinXP, OS X) all running OOo 3.1.1 and I only get "#NAME?" errors. Any ideas?

Enable macro + JRE

It uses macros. Did you enable macro security to allow it?
Did you install the JRE?