It's simple, really. First, you create two cubes, one slightly smaller than the other.
Then select one of the edge loops press 'O' to activate proportional editing and then select random falloff.
Switch to top view, click on the respective axis manipulator and drag forward.
NOTE : Switch between random falloff and smooth falloff if you feel the edges are too jagged.
Next, select the smaller cube and and add the Boolean Modifier and set the operation to "Difference", also make sure the Solver is set to "Bmesh" else the poly-flow may not be even and then press "Apply".
Hope this is the answer you were looking for. :)