EF is obtained by folding DE, so EF=DE. EC = DC- DE =8-ED, using Pythagorean theorem to find triangle CEF;
CF*CF+CE*CE=EF*EF, and if the above relationship is taken into account, there is 4*4+(8-ED)*(8-ED)=ED*ED, which can be solved. If ED=5, then EC=8-5=3cm.