Convert a SID to String with Java

A security identifier (SID) is an unique identifier, commonly used in Microsoft’s systems. For example, it’s used to identify users within Windows, or, more generally, within an Active Directory.

The SID is a binary value, with a variable length, that can be also be represented as a string. This conversion is implemented by the function called ConvertSidToStringSid, provided by the library Advapi32.dll, available only in Windows.

Hence, if you need to perform this conversion, you can procede with one of these two paths:

  • Use Advapi32 (only in Windows)
  • Rewrite the conversion
Thus, it’s very useful to have that implementation in a particular language (in our case Java), to be used everywhere. I noticed that, after a research in Internet, all the implementations are wrong, despite they work in general. Therefore, I decided to write my own implementation, thoroughly tested to prove you its correctness.

Read more

Integrating PeerSim with Eclipse

PeerSim, if you don’t know it, is a famous P2P networks simulator, written in Java. You can find its home clicking this link.

Surely, when you are writing in Java, it’s convenient to use Eclipse. In this article I will talk about how to configure eclipse to work with PeerSim. I decide to write this article mainly because I’ve founded some articles that talk about this integration; but I disagree with their solutions.

Read more

Miro Rubix comes back!

Hi! I just put online again the Miro Rubix game for PC and for PSP! A simple puzzle inspired by the famous game called Rubik’s Cube. The puzzle starts with two equal pictures where only the left one is mixed in various boxes. Moving the columns and the rows of the left one, you just have to form the picture on the right. The game comes with few puzzles. Some puzzles are classic, they contains only boxes with few colors; the other was created using various photos. But, you can create your own puzzle with your own photos!

Read more