Add EncryptAlgorithmMetaData defaultProperties. (#30905)

diff --git a/features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/api/config/EncryptRuleConfiguration.java b/features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/api/config/EncryptRuleConfiguration.java
index 5c07c43..0ead0f4 100644
--- a/features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/api/config/EncryptRuleConfiguration.java
+++ b/features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/api/config/EncryptRuleConfiguration.java
@@ -18,11 +18,13 @@
 package org.apache.shardingsphere.encrypt.api.config;
 
 import lombok.Getter;
-import lombok.RequiredArgsConstructor;
 import org.apache.shardingsphere.encrypt.api.config.rule.EncryptTableRuleConfiguration;
+import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithm;
+import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
 import org.apache.shardingsphere.infra.algorithm.core.config.AlgorithmConfiguration;
 import org.apache.shardingsphere.infra.config.rule.function.EnhancedRuleConfiguration;
 import org.apache.shardingsphere.infra.config.rule.scope.DatabaseRuleConfiguration;
+import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader;
 
 import java.util.Collection;
 import java.util.Map;
@@ -30,7 +32,6 @@
 /**
  * Encrypt rule configuration.
  */
-@RequiredArgsConstructor
 @Getter
 public final class EncryptRuleConfiguration implements DatabaseRuleConfiguration, EnhancedRuleConfiguration {
     
@@ -38,6 +39,15 @@
     
     private final Map<String, AlgorithmConfiguration> encryptors;
     
+    public EncryptRuleConfiguration(final Collection<EncryptTableRuleConfiguration> tables, final Map<String, AlgorithmConfiguration> encryptors) {
+        this.tables = tables;
+        this.encryptors = encryptors;
+        for (AlgorithmConfiguration each : encryptors.values()) {
+            TypedSPILoader.findUninitedService(EncryptAlgorithm.class, each.getType()).map(EncryptAlgorithm::getMetaData).map(EncryptAlgorithmMetaData::getDefaultProps)
+                    .ifPresent(each.getProps()::putAll);
+        }
+    }
+    
     @Override
     public boolean isEmpty() {
         return tables.isEmpty();
diff --git a/features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/spi/EncryptAlgorithmMetaData.java b/features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/spi/EncryptAlgorithmMetaData.java
index 01cc387..e16e6c9 100644
--- a/features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/spi/EncryptAlgorithmMetaData.java
+++ b/features/encrypt/api/src/main/java/org/apache/shardingsphere/encrypt/spi/EncryptAlgorithmMetaData.java
@@ -20,6 +20,8 @@
 import lombok.Getter;
 import lombok.RequiredArgsConstructor;
 
+import java.util.Properties;
+
 /**
  * Encrypt algorithm meta data.
  */
@@ -32,4 +34,6 @@
     private final boolean supportEquivalentFilter;
     
     private final boolean supportLike;
+    
+    private final Properties defaultProps;
 }
diff --git a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/assisted/MD5AssistedEncryptAlgorithm.java b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/assisted/MD5AssistedEncryptAlgorithm.java
index 1a9d9c2..474ab33 100644
--- a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/assisted/MD5AssistedEncryptAlgorithm.java
+++ b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/assisted/MD5AssistedEncryptAlgorithm.java
@@ -34,7 +34,7 @@
 public final class MD5AssistedEncryptAlgorithm implements EncryptAlgorithm {
     
     @Getter
-    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false);
+    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false, new Properties());
     
     private MessageDigestAlgorithm digestAlgorithm;
     
diff --git a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/standard/AESEncryptAlgorithm.java b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/standard/AESEncryptAlgorithm.java
index 89bf5cd..156b048 100644
--- a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/standard/AESEncryptAlgorithm.java
+++ b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/standard/AESEncryptAlgorithm.java
@@ -47,19 +47,27 @@
     private static final String DIGEST_ALGORITHM_NAME = "digest-algorithm-name";
     
     @Getter
-    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false);
+    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false, getDefaultProperties());
     
     private byte[] secretKey;
     
+    private Properties getDefaultProperties() {
+        Properties result = new Properties();
+        result.setProperty(DIGEST_ALGORITHM_NAME, MessageDigestAlgorithms.SHA_1);
+        return result;
+    }
+    
     @Override
     public void init(final Properties props) {
-        secretKey = getSecretKey(props);
+        Properties properties = new Properties(metaData.getDefaultProps());
+        properties.putAll(props);
+        secretKey = getSecretKey(properties);
     }
     
     private byte[] getSecretKey(final Properties props) {
         String aesKey = props.getProperty(AES_KEY);
         ShardingSpherePreconditions.checkNotEmpty(aesKey, () -> new AlgorithmInitializationException(this, "%s can not be null or empty", AES_KEY));
-        String digestAlgorithm = props.getProperty(DIGEST_ALGORITHM_NAME, MessageDigestAlgorithms.SHA_1);
+        String digestAlgorithm = props.getProperty(DIGEST_ALGORITHM_NAME);
         return Arrays.copyOf(DigestUtils.getDigest(digestAlgorithm.toUpperCase()).digest(aesKey.getBytes(StandardCharsets.UTF_8)), 16);
     }
     
diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreEncryptAlgorithmFixture.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreEncryptAlgorithmFixture.java
index 1a817ef..217a205 100644
--- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreEncryptAlgorithmFixture.java
+++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreEncryptAlgorithmFixture.java
@@ -22,10 +22,12 @@
 import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
 import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
 
+import java.util.Properties;
+
 @Getter
 public final class CoreEncryptAlgorithmFixture implements EncryptAlgorithm {
     
-    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false);
+    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false, new Properties());
     
     @Override
     public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryAssistedEncryptAlgorithmFixture.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryAssistedEncryptAlgorithmFixture.java
index d91d665..0ed7c19 100644
--- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryAssistedEncryptAlgorithmFixture.java
+++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryAssistedEncryptAlgorithmFixture.java
@@ -22,10 +22,12 @@
 import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
 import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
 
+import java.util.Properties;
+
 @Getter
 public final class CoreQueryAssistedEncryptAlgorithmFixture implements EncryptAlgorithm {
     
-    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false);
+    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false, new Properties());
     
     @Override
     public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryLikeEncryptAlgorithmFixture.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryLikeEncryptAlgorithmFixture.java
index 6295a91..a3c5a8a 100644
--- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryLikeEncryptAlgorithmFixture.java
+++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/fixture/CoreQueryLikeEncryptAlgorithmFixture.java
@@ -22,10 +22,12 @@
 import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
 import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
 
+import java.util.Properties;
+
 @Getter
 public final class CoreQueryLikeEncryptAlgorithmFixture implements EncryptAlgorithm {
     
-    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, false, true);
+    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, false, true, new Properties());
     
     @Override
     public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/fixture/DistSQLEncryptAlgorithmFixture.java b/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/fixture/DistSQLEncryptAlgorithmFixture.java
index 5a331f4..3225950 100644
--- a/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/fixture/DistSQLEncryptAlgorithmFixture.java
+++ b/features/encrypt/distsql/handler/src/test/java/org/apache/shardingsphere/encrypt/distsql/handler/fixture/DistSQLEncryptAlgorithmFixture.java
@@ -22,10 +22,12 @@
 import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
 import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
 
+import java.util.Properties;
+
 @Getter
 public final class DistSQLEncryptAlgorithmFixture implements EncryptAlgorithm {
     
-    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false);
+    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false, new Properties());
     
     @Override
     public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/infra/spi/src/main/java/org/apache/shardingsphere/infra/spi/type/typed/TypedSPILoader.java b/infra/spi/src/main/java/org/apache/shardingsphere/infra/spi/type/typed/TypedSPILoader.java
index c3c664c..3827f1b 100644
--- a/infra/spi/src/main/java/org/apache/shardingsphere/infra/spi/type/typed/TypedSPILoader.java
+++ b/infra/spi/src/main/java/org/apache/shardingsphere/infra/spi/type/typed/TypedSPILoader.java
@@ -65,6 +65,26 @@
         return Optional.empty();
     }
     
+    /**
+     * Find uninited service.
+     *
+     * @param serviceInterface typed SPI service interface
+     * @param type type
+     * @param <T> SPI class type
+     * @return found service
+     */
+    public static <T extends TypedSPI> Optional<T> findUninitedService(final Class<T> serviceInterface, final Object type) {
+        if (null == type) {
+            return findDefaultService(serviceInterface);
+        }
+        for (T each : ShardingSphereServiceLoader.getServiceInstances(serviceInterface)) {
+            if (matchesType(type, each)) {
+                return Optional.of(each);
+            }
+        }
+        return Optional.empty();
+    }
+    
     private static <T extends TypedSPI> Optional<T> findDefaultService(final Class<T> serviceInterface) {
         for (T each : ShardingSphereServiceLoader.getServiceInstances(serviceInterface)) {
             if (!each.isDefault()) {
diff --git a/proxy/backend/core/src/test/resources/expected/convert-encrypt.yaml b/proxy/backend/core/src/test/resources/expected/convert-encrypt.yaml
index 87054a9..5cc6879 100644
--- a/proxy/backend/core/src/test/resources/expected/convert-encrypt.yaml
+++ b/proxy/backend/core/src/test/resources/expected/convert-encrypt.yaml
@@ -31,6 +31,6 @@
 
 CREATE ENCRYPT RULE t_encrypt (
 COLUMNS(
-(NAME=user_id, CIPHER=user_cipher, ASSISTED_QUERY_COLUMN=user_assisted, LIKE_QUERY_COLUMN=user_like, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc'))), ASSISTED_QUERY_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc'))), LIKE_QUERY_ALGORITHM(TYPE(NAME='core.query_like.fixture'))),
-(NAME=order_id, CIPHER=order_cipher, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc'))))
+(NAME=user_id, CIPHER=user_cipher, ASSISTED_QUERY_COLUMN=user_assisted, LIKE_QUERY_COLUMN=user_like, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))), ASSISTED_QUERY_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))), LIKE_QUERY_ALGORITHM(TYPE(NAME='core.query_like.fixture'))),
+(NAME=order_id, CIPHER=order_cipher, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))))
 ));
diff --git a/proxy/backend/core/src/test/resources/expected/convert-mix.yaml b/proxy/backend/core/src/test/resources/expected/convert-mix.yaml
index 444c840..948e1d1 100644
--- a/proxy/backend/core/src/test/resources/expected/convert-mix.yaml
+++ b/proxy/backend/core/src/test/resources/expected/convert-mix.yaml
@@ -63,8 +63,8 @@
 
 CREATE ENCRYPT RULE t_encrypt (
 COLUMNS(
-(NAME=user_id, CIPHER=user_cipher, ASSISTED_QUERY_COLUMN=user_assisted, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc'))), ASSISTED_QUERY_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc')))),
-(NAME=order_id, CIPHER=order_cipher, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc'))))
+(NAME=user_id, CIPHER=user_cipher, ASSISTED_QUERY_COLUMN=user_assisted, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))), ASSISTED_QUERY_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1')))),
+(NAME=order_id, CIPHER=order_cipher, ENCRYPT_ALGORITHM(TYPE(NAME='aes', PROPERTIES('aes-key-value'='123456abc', 'digest-algorithm-name'='SHA-1'))))
 ));
 
 CREATE SHARDING TABLE RULE t_order (
diff --git a/test/e2e/driver/src/test/java/org/apache/shardingsphere/test/e2e/driver/fixture/encrypt/JDBCEncryptAlgorithmFixture.java b/test/e2e/driver/src/test/java/org/apache/shardingsphere/test/e2e/driver/fixture/encrypt/JDBCEncryptAlgorithmFixture.java
index 22e0459..afc013e 100644
--- a/test/e2e/driver/src/test/java/org/apache/shardingsphere/test/e2e/driver/fixture/encrypt/JDBCEncryptAlgorithmFixture.java
+++ b/test/e2e/driver/src/test/java/org/apache/shardingsphere/test/e2e/driver/fixture/encrypt/JDBCEncryptAlgorithmFixture.java
@@ -22,10 +22,12 @@
 import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
 import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
 
+import java.util.Properties;
+
 @Getter
 public final class JDBCEncryptAlgorithmFixture implements EncryptAlgorithm {
     
-    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false);
+    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false, new Properties());
     
     @Override
     public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/test/e2e/driver/src/test/java/org/apache/shardingsphere/test/e2e/driver/fixture/encrypt/JDBCQueryAssistedEncryptAlgorithmFixture.java b/test/e2e/driver/src/test/java/org/apache/shardingsphere/test/e2e/driver/fixture/encrypt/JDBCQueryAssistedEncryptAlgorithmFixture.java
index 76835ff..1fdf369 100644
--- a/test/e2e/driver/src/test/java/org/apache/shardingsphere/test/e2e/driver/fixture/encrypt/JDBCQueryAssistedEncryptAlgorithmFixture.java
+++ b/test/e2e/driver/src/test/java/org/apache/shardingsphere/test/e2e/driver/fixture/encrypt/JDBCQueryAssistedEncryptAlgorithmFixture.java
@@ -22,10 +22,12 @@
 import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
 import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
 
+import java.util.Properties;
+
 @Getter
 public final class JDBCQueryAssistedEncryptAlgorithmFixture implements EncryptAlgorithm {
     
-    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false);
+    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false, new Properties());
     
     @Override
     public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/test/e2e/fixture/src/test/java/org/apache/shardingsphere/test/e2e/fixture/ITEncryptLikeAlgorithmFixture.java b/test/e2e/fixture/src/test/java/org/apache/shardingsphere/test/e2e/fixture/ITEncryptLikeAlgorithmFixture.java
index 51ab4fa..f6bba77 100644
--- a/test/e2e/fixture/src/test/java/org/apache/shardingsphere/test/e2e/fixture/ITEncryptLikeAlgorithmFixture.java
+++ b/test/e2e/fixture/src/test/java/org/apache/shardingsphere/test/e2e/fixture/ITEncryptLikeAlgorithmFixture.java
@@ -53,7 +53,7 @@
     private static final int MAX_NUMERIC_LETTER_CHAR = 255;
     
     @Getter
-    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, true);
+    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, true, new Properties());
     
     private int delta;
     
diff --git a/test/e2e/sql/src/test/resources/cases/rdl/dataset/rdl_empty_rules/alter_encrypt_rule.xml b/test/e2e/sql/src/test/resources/cases/rdl/dataset/rdl_empty_rules/alter_encrypt_rule.xml
index 9d7cef4..57cdd9b 100644
--- a/test/e2e/sql/src/test/resources/cases/rdl/dataset/rdl_empty_rules/alter_encrypt_rule.xml
+++ b/test/e2e/sql/src/test/resources/cases/rdl/dataset/rdl_empty_rules/alter_encrypt_rule.xml
@@ -29,5 +29,5 @@
         <column name="like_query_type" />
         <column name="like_query_props" />
     </metadata>
-    <row values="t_user| pwd| pwd_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abcd&quot;}| | | | " />
+    <row values="t_user| pwd| pwd_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abcd&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
 </dataset>
diff --git a/test/e2e/sql/src/test/resources/cases/rdl/dataset/rdl_empty_rules/create_encrypt_rule.xml b/test/e2e/sql/src/test/resources/cases/rdl/dataset/rdl_empty_rules/create_encrypt_rule.xml
index 78943c0..6f617e6 100644
--- a/test/e2e/sql/src/test/resources/cases/rdl/dataset/rdl_empty_rules/create_encrypt_rule.xml
+++ b/test/e2e/sql/src/test/resources/cases/rdl/dataset/rdl_empty_rules/create_encrypt_rule.xml
@@ -29,5 +29,5 @@
         <column name="like_query_type" />
         <column name="like_query_props" />
     </metadata>
-    <row values="t_user| pwd| pwd_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
+    <row values="t_user| pwd| pwd_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
 </dataset>
diff --git a/test/e2e/sql/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_encrypt_rule.xml b/test/e2e/sql/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_encrypt_rule.xml
index 78943c0..6f617e6 100644
--- a/test/e2e/sql/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_encrypt_rule.xml
+++ b/test/e2e/sql/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_encrypt_rule.xml
@@ -29,5 +29,5 @@
         <column name="like_query_type" />
         <column name="like_query_props" />
     </metadata>
-    <row values="t_user| pwd| pwd_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
+    <row values="t_user| pwd| pwd_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
 </dataset>
diff --git a/test/e2e/sql/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_encrypt_rules.xml b/test/e2e/sql/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_encrypt_rules.xml
index eff9bae..ce264dc 100644
--- a/test/e2e/sql/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_encrypt_rules.xml
+++ b/test/e2e/sql/src/test/resources/cases/rql/dataset/dbtbl_with_readwrite_splitting_and_encrypt/show_encrypt_rules.xml
@@ -29,7 +29,7 @@
         <column name="like_query_type" />
         <column name="like_query_props" />
     </metadata>
-    <row values="t_user| pwd| pwd_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
-    <row values="t_user_details| number| number_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
-    <row values="t_user_details| number_new| number_new_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
+    <row values="t_user| pwd| pwd_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
+    <row values="t_user_details| number| number_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
+    <row values="t_user_details| number_new| number_new_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
 </dataset>
diff --git a/test/e2e/sql/src/test/resources/cases/rql/dataset/encrypt/show_encrypt_rule.xml b/test/e2e/sql/src/test/resources/cases/rql/dataset/encrypt/show_encrypt_rule.xml
index a613cd0..8500f38 100644
--- a/test/e2e/sql/src/test/resources/cases/rql/dataset/encrypt/show_encrypt_rule.xml
+++ b/test/e2e/sql/src/test/resources/cases/rql/dataset/encrypt/show_encrypt_rule.xml
@@ -29,8 +29,8 @@
         <column name="like_query_type" />
         <column name="like_query_props" />
     </metadata>
-    <row values="t_user| user_name| user_name_cipher| | user_name_like| AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | IT.ENCRYPT.LIKE.FIXTURE| {&quot;mask&quot;:4093}" />
-    <row values="t_user| password| password_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
-    <row values="t_user| email| email_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
-    <row values="t_user| telephone| user_telephone_cipher| | user_telephone_like| AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | IT.ENCRYPT.LIKE.FIXTURE| {&quot;mask&quot;:4093}" />
+    <row values="t_user| user_name| user_name_cipher| | user_name_like| AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | IT.ENCRYPT.LIKE.FIXTURE| {&quot;mask&quot;:4093}"/>
+    <row values="t_user| password| password_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
+    <row values="t_user| email| email_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
+    <row values="t_user| telephone| user_telephone_cipher| | user_telephone_like| AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | IT.ENCRYPT.LIKE.FIXTURE| {&quot;mask&quot;:4093}"/>
 </dataset>
diff --git a/test/e2e/sql/src/test/resources/cases/rql/dataset/encrypt/show_encrypt_rules.xml b/test/e2e/sql/src/test/resources/cases/rql/dataset/encrypt/show_encrypt_rules.xml
index 7704ba6..1e9c089 100644
--- a/test/e2e/sql/src/test/resources/cases/rql/dataset/encrypt/show_encrypt_rules.xml
+++ b/test/e2e/sql/src/test/resources/cases/rql/dataset/encrypt/show_encrypt_rules.xml
@@ -29,12 +29,12 @@
         <column name="like_query_type" />
         <column name="like_query_props" />
     </metadata>
-    <row values="t_user| user_name| user_name_cipher| | user_name_like| AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | IT.ENCRYPT.LIKE.FIXTURE| {&quot;mask&quot;:4093}" />
-    <row values="t_user| password| password_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
-    <row values="t_user| email| email_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
-    <row values="t_user| telephone| user_telephone_cipher| | user_telephone_like| AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | IT.ENCRYPT.LIKE.FIXTURE| {&quot;mask&quot;:4093}" />
-    <row values="t_user_details| number| number_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
-    <row values="t_user_details| number_new| number_new_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
-    <row values="t_merchant| business_code| business_code_cipher| | business_code_like| AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | IT.ENCRYPT.LIKE.FIXTURE | {&quot;mask&quot;:4093} " />
-    <row values="t_merchant| telephone| merchant_telephone_cipher| | merchant_telephone_like| AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | IT.ENCRYPT.LIKE.FIXTURE | {&quot;mask&quot;:4093} " />
+    <row values="t_user| user_name| user_name_cipher| | user_name_like| AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | IT.ENCRYPT.LIKE.FIXTURE| {&quot;mask&quot;:4093}"/>
+    <row values="t_user| password| password_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
+    <row values="t_user| email| email_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
+    <row values="t_user| telephone| user_telephone_cipher| | user_telephone_like| AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | IT.ENCRYPT.LIKE.FIXTURE| {&quot;mask&quot;:4093}"/>
+    <row values="t_user_details| number| number_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
+    <row values="t_user_details| number_new| number_new_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
+    <row values="t_merchant| business_code| business_code_cipher| | business_code_like| AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | IT.ENCRYPT.LIKE.FIXTURE | {&quot;mask&quot;:4093} "/>
+    <row values="t_merchant| telephone| merchant_telephone_cipher| | merchant_telephone_like| AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | IT.ENCRYPT.LIKE.FIXTURE | {&quot;mask&quot;:4093} "/>
 </dataset>
diff --git a/test/e2e/sql/src/test/resources/cases/rql/dataset/encrypt_and_readwrite_splitting/show_encrypt_rule.xml b/test/e2e/sql/src/test/resources/cases/rql/dataset/encrypt_and_readwrite_splitting/show_encrypt_rule.xml
index 78943c0..6f617e6 100644
--- a/test/e2e/sql/src/test/resources/cases/rql/dataset/encrypt_and_readwrite_splitting/show_encrypt_rule.xml
+++ b/test/e2e/sql/src/test/resources/cases/rql/dataset/encrypt_and_readwrite_splitting/show_encrypt_rule.xml
@@ -29,5 +29,5 @@
         <column name="like_query_type" />
         <column name="like_query_props" />
     </metadata>
-    <row values="t_user| pwd| pwd_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
+    <row values="t_user| pwd| pwd_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
 </dataset>
diff --git a/test/e2e/sql/src/test/resources/cases/rql/dataset/encrypt_and_readwrite_splitting/show_encrypt_rules.xml b/test/e2e/sql/src/test/resources/cases/rql/dataset/encrypt_and_readwrite_splitting/show_encrypt_rules.xml
index d55eca2..37a6dc0 100644
--- a/test/e2e/sql/src/test/resources/cases/rql/dataset/encrypt_and_readwrite_splitting/show_encrypt_rules.xml
+++ b/test/e2e/sql/src/test/resources/cases/rql/dataset/encrypt_and_readwrite_splitting/show_encrypt_rules.xml
@@ -29,9 +29,9 @@
         <column name="like_query_type" />
         <column name="like_query_props" />
     </metadata>
-    <row values="t_user| pwd| pwd_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
-    <row values="t_user_details| number| number_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
-    <row values="t_user_details| number_new| number_new_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
-    <row values="t_merchant| business_code| business_code_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
-    <row values="t_merchant| telephone| telephone_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
+    <row values="t_user| pwd| pwd_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
+    <row values="t_user_details| number| number_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
+    <row values="t_user_details| number_new| number_new_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
+    <row values="t_merchant| business_code| business_code_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
+    <row values="t_merchant| telephone| telephone_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
 </dataset>
diff --git a/test/e2e/sql/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_encrypt_rule.xml b/test/e2e/sql/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_encrypt_rule.xml
index 78943c0..6f617e6 100644
--- a/test/e2e/sql/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_encrypt_rule.xml
+++ b/test/e2e/sql/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_encrypt_rule.xml
@@ -29,5 +29,5 @@
         <column name="like_query_type" />
         <column name="like_query_props" />
     </metadata>
-    <row values="t_user| pwd| pwd_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
+    <row values="t_user| pwd| pwd_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
 </dataset>
diff --git a/test/e2e/sql/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_encrypt_rules.xml b/test/e2e/sql/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_encrypt_rules.xml
index d55eca2..37a6dc0 100644
--- a/test/e2e/sql/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_encrypt_rules.xml
+++ b/test/e2e/sql/src/test/resources/cases/rql/dataset/sharding_and_encrypt/show_encrypt_rules.xml
@@ -29,9 +29,9 @@
         <column name="like_query_type" />
         <column name="like_query_props" />
     </metadata>
-    <row values="t_user| pwd| pwd_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
-    <row values="t_user_details| number| number_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
-    <row values="t_user_details| number_new| number_new_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
-    <row values="t_merchant| business_code| business_code_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
-    <row values="t_merchant| telephone| telephone_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;}| | | | " />
+    <row values="t_user| pwd| pwd_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
+    <row values="t_user_details| number| number_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
+    <row values="t_user_details| number_new| number_new_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
+    <row values="t_merchant| business_code| business_code_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
+    <row values="t_merchant| telephone| telephone_cipher| | | AES| {&quot;aes-key-value&quot;:&quot;123456abc&quot;,&quot;digest-algorithm-name&quot;:&quot;SHA-1&quot;}| | | | "/>
 </dataset>
diff --git a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteEncryptLikeAlgorithmFixture.java b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteEncryptLikeAlgorithmFixture.java
index 12f9dd3..c23e7f9 100644
--- a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteEncryptLikeAlgorithmFixture.java
+++ b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteEncryptLikeAlgorithmFixture.java
@@ -53,7 +53,7 @@
     private static final int MAX_NUMERIC_LETTER_CHAR = 255;
     
     @Getter
-    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, true);
+    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, true, new Properties());
     
     private int delta;
     
diff --git a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteNormalEncryptAlgorithmFixture.java b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteNormalEncryptAlgorithmFixture.java
index 3cc8854..8c8c65d 100644
--- a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteNormalEncryptAlgorithmFixture.java
+++ b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteNormalEncryptAlgorithmFixture.java
@@ -22,10 +22,12 @@
 import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
 import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
 
+import java.util.Properties;
+
 @Getter
 public final class RewriteNormalEncryptAlgorithmFixture implements EncryptAlgorithm {
     
-    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false);
+    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(true, true, false, new Properties());
     
     @Override
     public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteQueryAssistedEncryptAlgorithmFixture.java b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteQueryAssistedEncryptAlgorithmFixture.java
index e3c1a88..27950fb 100644
--- a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteQueryAssistedEncryptAlgorithmFixture.java
+++ b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteQueryAssistedEncryptAlgorithmFixture.java
@@ -22,10 +22,12 @@
 import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
 import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
 
+import java.util.Properties;
+
 @Getter
 public final class RewriteQueryAssistedEncryptAlgorithmFixture implements EncryptAlgorithm {
     
-    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false);
+    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false, new Properties());
     
     @Override
     public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteQueryLikeEncryptAlgorithmFixture.java b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteQueryLikeEncryptAlgorithmFixture.java
index 21913c0..c2cccdb 100644
--- a/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteQueryLikeEncryptAlgorithmFixture.java
+++ b/test/it/rewriter/src/test/java/org/apache/shardingsphere/test/it/rewrite/fixture/encrypt/RewriteQueryLikeEncryptAlgorithmFixture.java
@@ -22,10 +22,12 @@
 import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
 import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
 
+import java.util.Properties;
+
 @Getter
 public final class RewriteQueryLikeEncryptAlgorithmFixture implements EncryptAlgorithm {
     
-    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, true);
+    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, true, new Properties());
     
     @Override
     public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {
diff --git a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/commons/algorithm/TestQueryAssistedShardingEncryptAlgorithm.java b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/commons/algorithm/TestQueryAssistedShardingEncryptAlgorithm.java
index 3bbf6ee..2743bb1 100644
--- a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/commons/algorithm/TestQueryAssistedShardingEncryptAlgorithm.java
+++ b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/commons/algorithm/TestQueryAssistedShardingEncryptAlgorithm.java
@@ -22,10 +22,12 @@
 import org.apache.shardingsphere.encrypt.spi.EncryptAlgorithmMetaData;
 import org.apache.shardingsphere.infra.algorithm.core.context.AlgorithmSQLContext;
 
+import java.util.Properties;
+
 @Getter
 public final class TestQueryAssistedShardingEncryptAlgorithm implements EncryptAlgorithm {
     
-    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false);
+    private final EncryptAlgorithmMetaData metaData = new EncryptAlgorithmMetaData(false, true, false, new Properties());
     
     @Override
     public String encrypt(final Object plainValue, final AlgorithmSQLContext algorithmSQLContext) {