I've never worked with cryptsetup -- but I'm surprised it echoes the passphrase.
Maybe something like this will do what you want:
read -s -p "Enter password: " mypass
echo $mypass | cryptsetup luksOpen /dev/md0 raid_data
I haven't tried it, but just from eyeballing, it looks like it should (might ;-) work.