Geometry question involving triangle Question:

$ABC$ is a right angle triangle at $A$. $AD$ is the altitude through A; E is a point on AC such that $AE=CD$. F is a poibnt on AB such that $AF=BD$. Prove that $BE=CF$.
Challenge And Thrill Of Pre-College Mathematics - Exercise 3.5

My attempt:
I prepared this diagram:

on GeoGebra. Even after trying a lot, I can't progress at all in this question. Can someone please help me out with some hints or anything?
Thanks!
 A: It's enough to show that
$$|BD|^2 + |AC|^2 \stackrel{\color{red}{?}}{=} |CD|^2 + |AB|^2$$
Rearranging we get
$$|AC|^2 - |CD|^2 = |AD|^2 = |AB|^2 - |BD|^2$$
which ends the proof.
I hope this helps $\ddot\smile$
A: Writing up Pythagoras for the two sides in question, we have
$$
AE^2 + AB^2 = BE^2\\
AF^2 + AC^2 = CF^2
$$
Now, from the similarity of the three triangles $\triangle ABC, \triangle ABD, \triangle ADC$, we have $\frac{AB}{BD} = \frac{CB}{AB}$ and $\frac{AC}{CD} = \frac{CB}{AC}$. This gives
$$
AB^2 = BD \cdot CB = BD(BD + CD)\\
AC^2 = CD\cdot CB = CD(CD + BD)
$$
Inserting into the Pythagorean equations above, we get
$$
AE^2 + BD(BD + CD) = BE^2\\
AF^2 + CD(CD + BD) = CF^2
$$
By inserting $AF = BD$ and $AE = CD$ into these equations, both left-hand sides evaluates to the same value, and thus the right-hand sides must be equal as well.
A: let $CD=p$ and $DB=q$ then we get after the theorem of Phytagorean 
$$CF^2=b^2+q^2$$ and $$BE^2=c^2+q^2$$
it must be
$$b^2=c^2+p^2-q^2$$
this is clear when we use that
$$p^2+h^2=b^2$$ and $$q^2+h^2=c^2$$ and we get $$h=h$$
we have $$BE^2=AE^2+c^2$$ and since $$AE=CD=q$$ we get  $$BE^2=c^2+q^2$$
