In a dry saute pan, toast the dried shrimp over medium heat until aromatic but not browned. Place aside.
Use paper towels to cover a plate. In a wok or saute pan, heat the oil over medium heat. One at a time, fry the chiles for about 12 seconds each, or until they are brittle but not burnt and have a dark red color. Use a slotted spoon to transfer the fried chiles to the dish covered in paper towels.
Continue by frying the shallots one at a time in the same oil until they are browned and then draining them on paper towels. Repeat with the garlic cloves and then the dried shrimp. Set them aside and make sure that everything cool to room temperature. Measure the cooled oil after it has been strained, then add more oil to make 1/2 cup
Use a pestle and a large mortar to grind the dried shrimp and fried chilies into a fine powder. To create a smooth and wet paste, add the fried shallots and garlic. Scrape the paste into a bowl and combine with the sugar, fish sauce, and tamarind water and mix them well. Remix after adding the reserved 1/2 cup oil.
Use right away, or store in the fridge for up to 4 weeks with a tight cover.
Tamarind water is sold at Asian markets.