A for loop is unnecessary. Use strings to output a filename and a decimal offset, then pipe any strings of at least three chars long to egrep:
strings -n 3 -f -t d ./* 2> /dev/null |
egrep '[[:alnum:][:punct:]]*(secret|password|key|credential|http)[['\
'[[:alnum:][:punct:]]*$'
Three chars instead of the default four is needed so as not to miss "key".
Since we lack sample input files, here's a demo showing the first ten hits in the /bin/ directory:
strings -n 3 -f -t d /bin/* 2> /dev/null |
egrep '[[:alnum:][:punct:]]*(secret|password|key|credential|http)[['\
'[[:alnum:][:punct:]]*$' |
head
Output on my system:
/bin/bash: 78590 rl_discard_keymap
/bin/bash: 78720 rl_executing_key
/bin/bash: 79076 rl_bind_key
/bin/bash: 79847 emacs_standard_keymap
/bin/bash: 79905 _rl_keymap
/bin/bash: 81110 _rl_executing_keyseq_size
/bin/bash: 81598 rl_bind_keyseq_if_unbound
/bin/bash: 81640 rl_bind_keyseq
/bin/bash: 81736 bind_keyseq_to_unix_command
/bin/bash: 81863 _rl_dispatching_keymap