“Be strong and courageous, all you who put your hope in the LORD.” (Psalms 31:24 HCSB)

I am inclined to agree more with the Young’s Literal Translation here which reads:

“Be strong, and He strengtheneth your heart, All ye who are waiting for Jehovah!” (Psalms 31:24 YNG)

The structure of the Hebrew can be taken either way, but it seems like the more natural reading (although the more difficult to understand) is the literal translation.  So the meaning becomes “Be strong in the one who strengthens your heart, all of you who hope in the Lord.”  This does a good job of holding the biblical tension of “doing” and “depending.”  As Paul explains it:

“Work out your own salvation with fear and trembling. For it is God who is working in you, enabling you both to desire and to work out His good purpose.” (Philippians 2:12–13 HCSB)