Encoding and decoding method of contents file

A method for encoding and decoding a content file is provided to strengthen security and increase encoding/decoding speed in a DRM(Digital Rights Management) system by encoding and decoding a DRM content file after dividing the DRM content file into a plurality of data blocks. An encoded content file is divided into a plurality of data blocks(S10). The data blocks are grouped into a plurality of groups according to preset group sizes(S20). A plurality of group content keys corresponding to the groups are generated(S30). A plurality of data block keys for the data blocks included in the groups are generated by inputting the group content keys into a hash function(S40). The data blocks are decoded by using the block keys(S50).