我这有另一种写法
 public String encryptStr(String strMing) {  
       byte [] byteMi = null ;  
       byte [] byteMing = null ;  
       String strMi = "" ;  
       BASE64Encoder base64en = new BASE64Encoder();  
       try {  
           byteMing = strMing.getBytes( "UTF8" );  
           byteMi = this .encryptByte(byteMing);  
           strMi = base64en.encode(byteMi);  
       } catch (Exception e) {  
           throw new RuntimeException(  
                  "Error initializing SqlMap class. Cause: " + e);  
       } finally {  
           base64en = null ;  
           byteMing = null ;  
           byteMi = null ;  
       }  
       return strMi;  
    }