Boil some water and pour it over the dried chilies in a bowl. Soak for 15 minutes.
Meanwhile, crush the white pepper, coriander seeds, and cumin seeds using a pestle and mortar. Briefly toast them in a small, dry pan over medium heat and set aside.
Cut off the tough end of the lemongrass stems, then thinly slice the white part. You don't need the green part for this recipe.
Peel and thinly slice the red onion.
Peel the garlic cloves.
Peel the galangal, then cut into three slices.
If using, remove the zest from the kaffir limes. If using kaffir lime leaves instead, remove the thick stem from the middle, then slice up the halved leaves.
Take the chilies out of the water and pat dry. Cut off the top, then roughly chop them up. If you want to cut down on the heat, discard the seeds.
Put all the prepared ingredients into a food processor and blend into a paste. Add up to 2tbsp of liquid coconut milk or water to make it smoother if desired.
If you want to reserve any paste for a later date, freeze it at this point.