Postagens

Mostrando postagens com o rótulo EN

AES Cipher in Java

How to implementing AES cipher in JAVA and main problems you may find in this challenge. When I started, I tried to do a parallel between my 3Des implementation and AES , so I discovered the first difference: I tried to generate a SecretKey from a pass-phrase for AES in the following way, KeySpec aesSpec = new KeySpec(key.getBytes(), "AES"); SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("AES"); SecretKey secretKey = keyFactory.generateSecret(aesSpec); This is the very similar how I do with 3Des : KeySpec TDesSpec = new DESKeySpec( key.getBytes()); SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DESede"); SecretKey secretKey = keyFactory.generateSecret(aesSpec); However when I tested, it threw an exception "AES SecretKeyFactory not available". So the solution was made some small change: SecretKey secretKey = new SecretKeySpec( key.getBytes() , "AES"); There are two hints here: The key...

How convert a data from Hexa to Byte Array

Problem! Promote the conversion between hex data to byte array and reverse. Sample: Hex 30 = 0 Byte[48] = 0 Java                                                   final protected static char [] HEX_ARRAY = "0123456789ABCDEF" .toCharArray(); private static byte [] toByteArray(String hexString) throws HexStringException {     int len = hexString.length();     byte [] data = new byte [len / 2];     try     {        for ( int i = 0; i < len; i += 2)       {           data[i / 2] = ( byte ) ((Character.digit(hexString.charAt(i), 16) << 4) +                    Character.digit(hexString.charAt(i + 1), 16));       }    } catch (Exception e)    {...

How use the LZMA SDK (7Zip)

Imagem
How extend the LZMA with C/C++ and implement customized softwares using the 7Zip library. First of all, what is LZMA SDK? LZMA SDK is a package with all you need to extend and developing your own application without recreate the wheel! It is complete with documentation, samples, interfaces, libraries and tools to help in the use of compaction  algorithm LZMA in custom applications. What languages are supported by the LZMA SDK? The SDK supports the following languages C, C++, C# and Java. [ + ] Licence How the own site said, " LZMA SDK  is placed in the  public domain. " and goes beyond " Anyone is free to copy, modify, publish, use, compile, sell, or distribute the original LZMA SDK code, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. " I understand, that you can use library for commercial or non commercial purpose, without restrictions. Enviroment of development I will use ...

Why I can't use rich text editor on my sharepoint page?

Imagem
The problem! This week I tried to create a new wiki page to describe some information about the project I've been worked and I've written on sharepoint, because this is the corporative tool at the company where I work. For my surprise the work didn't was very productive and I was needing to use all my background in write HTML code, so I think there is something wrong, this was very technical and I went talking with a friend about that, suddenly I had discovered the real problem. My sharepoint didn't show the rich text editor! Why? I did one search on internet and didn't find the root cause, but some suspects! But what really resolved was change the IE version! Resolution How I was using the 64 bits IE version: I saw many comments about the 64 bits IE version didn't work well with the sharepoint, but no one said the root reason! However I just tried this solution and I had success! How this solution didn't bring any problem, so I passed ...

How config Maven to work with NTLM proxy

I have been worked with Maven [+] some time and I can to affirm that is one the best tools to the management of software projects and comprehension, incredibly powerfull, versatile, but far from unanimous among developers. I like to show that is a personal opinion and I respect all other points of view. This post was born from the necessity of install Maven on my developer environment, that has a kind of proxy (NTLM), because until then I saw situations where only was necessary configure the settings.xml file, like described on Maven documentation  (Maven configurando proxy) . Error Message The error message below was constantly displayed when I tried to run the mvn clean install command in the project: C:Dev\MavenTest> mvn clean install [ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifa escriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1: Could not transfer artifa...

How a good README file is important

In the rush of a day's work with several projects going on in parallel, it is not hard to come across someone asking you for help (support) for something you developed recently, but hasn't make the slightest idea how use this program or utility currently. I don't know if it happens with you, but with me it happens much. Many times when I do the review of something I had developed and passed a little time without see, I stay surprised with it, sometimes as a positive surprise and others not so much! Each one do the organization the way it believed to be more productive, but as I usually create many tools for myself and sometimes I share it with other staff members, so it's necessary leave a document for quick reference in templates README  [+]  and it ends up helping in the process of rescue the subject and even as a user manual. The content of a README file In my point of view, a file as this can have anything what is necessary to help in the development an...