Place peanuts in a single layer and roast in a 350°F (180°C) oven for about 13 to 15 minutes until lightly browned. Remove and immediately toss with salt and five-spice powder. Set aside and allow it to cool.
Line a 10 in x 6½ in pan with parchment paper (please see recipe notes below). Sprinkle half the sesame seeds and all the nuts over base of tin. Sprinkle the red chili flakes on the top. Set aside.
In a small saucepan, combine sugar, vinegar, and water. Stir over low heat until sugar dissolves. This should take about 3 minutes. Bring to a boil. Cover and allow it to continue boiling for approximately 16 minutes or until sugar turns a light amber color or is between 300°F (149°C) and 310°F (154°C). Turn off heat.
Pour melted sugar over peanuts and sesame seeds. Sprinkle the remaining sesame seeds evenly on the top.
After about 5 minutes cut candy into rectangles before it cools completely.